Fixed bug just having custom port number broke links on the site.

Fixed bug where if the public_hostname is not provided and niginx_port is other than 80, the generated hostname in nginx configuration is incorrect as it doesn't include custom port.

Also removed http://$host as $host variable does not contain port number.