Welcome! Log In Create A New Profile

Advanced

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

SW@EU via nginx
May 22, 2018 12:00PM
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._______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

SW@EU via nginx May 22, 2018 12:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready