nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

proxy_set_header Host $http_host setting does not take effect

Open chung1912 opened this issue 1 year ago • 5 comments

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

Nginx Proxy Manager Version

2.11.3

To Reproduce Steps to reproduce the behavior: After proxy_set_header Host $http_host is set, it will be placed at the front of "location", resulting in the configuration not being effective. For details, please see the figure My configuration on the page is as follows: image The configuration information seen in conf is as follows: image As shown in the figure, since proxy_set_header Host $host; is generated by default and is after proxy_set_header Host $http_host;, proxy_set_header Host $host; will take effect.

Expected behavior

Custom configuration should be placed at the end, not at the beginning, to ensure that the custom configuration can take effect normally, as shown in the following figure image

Operating System

Additional context

chung1912 avatar Sep 20 '24 07:09 chung1912

Same problem

eliasmainetti avatar Sep 27 '24 09:09 eliasmainetti

This seems to be a very very common issue with many open tickets. The root of the issue appears to be using $host instead of $http_host in the root proxy.conf and _location.conf for any of us unfortunate souls not running NPM on default browser ports 80/443, but I don't know if there are any breaking effects of having that change globally. For many downstream applications it does not matter but for some (e.g. Kavita, Home Assistant) not everything works. Hoping this can be addressed once and for all 🙏

swensorm avatar Oct 19 '24 15:10 swensorm

There is a problematic commit https://github.com/NginxProxyManager/nginx-proxy-manager/commit/280bac8b430a3465f1fbc4d7e8d94e148ad740e7 which breaks the entire custom directions setting. No one seem to care about fixing it at all.

Update: This is more harsh than I imagined. Seems like there should be only one proxy_set_header Host so simply changing the template would not work. Need some more logic to make sure either proxy_set_header Host $host or proxy_set_header Host $http_host only appear once.

whc2001 avatar Oct 21 '24 18:10 whc2001

same issue. nginx proxy manager is broken v2.12.1

Error "Could not delete file:" occurs only when setting ssl for a domain in the gui.

wakawakaaa avatar Nov 19 '24 20:11 wakawakaaa

This is a blocking bug that makes the custom configurations almost to totally useless. BTW, This is a duplicate of #3980.

information-security avatar Jun 10 '25 19:06 information-security

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Dec 19 '25 02:12 github-actions[bot]