The Java servlet request.getRequestURL() method returned a result without a port proxy_set_header host needs to set to variable $http_host variable but now it is variable $host