Use port from request and scheme-relative for ElasticSearch URL

Use the port from the URL, and scheme-relative url to pick up the right http/https from the request