backport fixes to upstream

return public_url from config for discovery
fix url creation for resources
fix install script. add setting of public_url to install script.
update sample config
rework regions and remove public_url from config

Change-Id: I1159f2ac8eeeb01433ec2373600475cd6b8a6688