Added test/code to find serving url in cloud deployments

Fixes a problem when a dash can be in the FQDN (as is the case in EC2).