NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.61k stars 2.63k forks source link

make the posibility to choose the way the host and x-forward-x are set in _location.conf #3981

Open mcarbonneaux opened 1 month ago

mcarbonneaux commented 1 month ago

Is your feature request related to a problem? Please describe. actualy after commit https://github.com/NginxProxyManager/nginx-proxy-manager/commit/280bac8b430a3465f1fbc4d7e8d94e148ad740e7 you cannot fix host and x-forward-xxx header in advanced config.

because the advanced config in _location.conf template are now before default config and in default config you set host header like that (and some x-forward headers):

proxy_set_header Host $host;

this make impossible to use Nginx Proxy Manager with application that control not only the fqdn but also the port used of the host header sended by nginx (if are behind nat port forwarding for example).

like her : https://github.com/esphome/issues/issues/4327

Describe the solution you'd like To preserve the host AND the port you MUST use $http_host nginx variable in place of $host: https://serverfault.com/questions/706438/what-is-the-difference-between-nginx-variables-host-http-host-and-server-na

Because http_host is http_HEADER and is value of host header sended by the navigator.

Is different than host that are processed host by nginx that use listen port in place of the host header port.

Can you replace host by http_host by default or add the posibility to switch in option the way the template generate the host header ?

Describe alternatives you've considered Revert commit https://github.com/NginxProxyManager/nginx-proxy-manager/commit/280bac8b430a3465f1fbc4d7e8d94e148ad740e7 that bloc the possibility to overide the host and x-forward-xxx headers.

Or add option to abel to choose the placement of the advanced option before or after default config.