how are port number in $host handled if I specify $host:<port number>

SW@EU ente.trompete at protonmail.com
Tue May 22 15:59:01 UTC 2018


Hi,
if I read the Module ngx_http_proxy_module documentation I will find e.g. an possible header rewrite in this way

proxy_set_header Host       $host:$proxy_port;

but what would happens here if $host contains already a port number because the server does not listen on a default port. Maybe the server is listening on port 8080 but  $proxy_port is 8081. Is the header then "Host: $hostname:8080:8081" or has nginx an automatic in this case that the port part is removed from $host if a port is separately specified? The same question for $proxy_host:<port number> and  $proxy_host contains already a port number.
Unfortunately  I don't find any information about variable handling in nginx :-(.

TIA,
SW

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180522/50bec2d5/attachment.html>


More information about the nginx mailing list