mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #1003] Custom Nginx Configuration - proxy_set_header Host #841
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#841
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DaFlowah on GitHub (Apr 8, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1003
Describe the bug
Hi, I need to override the
default proxy_set_header Host $hosttoproxy_set_header Host $http_hostfor a specific Proxy Host, since it's required by the app I'm trying to Proxy (more info here)To Reproduce
Create a Proxy Host
Go to Advanced and add
proxy_set_header Host $http_host;The value is not applied and the application throws an error.
Expected behavior
I am expecting this value to be added.
Screenshots

Operating System
Additional context
If on the host I edit
/etc/nginx/conf.d/include/proxy.confand change the default value, it works, but it's a temporary change.@ananiasfilho commented on GitHub (Jul 4, 2021):
Any update? I have same issue running flask and odoo behind NPM. I cant see client IP and others headers
@Nate-09 commented on GitHub (Jul 27, 2021):
Same here, got the same issue with another docker image running remotely.one. I'm also having additional issues with NPM not setting additional configuration under the custom config, wondering if this is an issue with the custom configuration in UI itself.
I've tried to also set additional header info as seen below but when I test for the CSP - these come back as fail from external testing on top of the Client IP and other headers
add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy no-referrer always;
add_header X-Robots-Tag none;
proxy_hide_header Upgrade;
proxy_hide_header X-Powered-By;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@netstx commented on GitHub (Aug 26, 2022):
There's a warning about this right underneath the text box where you add these custom configs:
Please note, that any add_header or set_header directives added here will not be used by nginx. You will have to add a custom location '/' and add the header in the custom config there.@a18ccms commented on GitHub (Oct 25, 2022):
add a custom location '/' and add the header in the custom config :proxy_set_header Host $http_host;
web is 400 Bad Request
@jschlatow commented on GitHub (Dec 29, 2022):
I have walked the same road when I just noticed that a possible solution has been suggested in #1477.
@GAS85 commented on GitHub (Feb 21, 2023):
Basically you have to edit
/data/nginx/custom/server_proxy.confthat is designed for such a changes.I agree that UI management should be add here. As also that those settings are common for all proxies that you will create.
P.S. you do not need to set
add_header X-Frame-Options "SAMEORIGIN";this could be managed via Docker Envs.@github-actions[bot] commented on GitHub (Mar 14, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@GAS85 commented on GitHub (Mar 14, 2024):
👍
@jschlatow commented on GitHub (Mar 14, 2024):
👍
@whc2001 commented on GitHub (Jul 6, 2024):
I think even adding the config into custom location won't work, since the directives will be added above the default config and get overriden
@ConfidentKeyboard commented on GitHub (Oct 17, 2024):
I've tried everything here, and it still doesn't seem to work. On Unraid with nginx-proxy-manager-official. Any suggestions?
@whc2001 commented on GitHub (Oct 17, 2024):
Someone pushed a bugged commit which broke the behaviour of custom directions. You need to edit the config file in data dir and never touch the WebUI again.
@ConfidentKeyboard commented on GitHub (Oct 17, 2024):
I assume an update would then overwrite any changes I make as well?
@github-actions[bot] commented on GitHub (Apr 26, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍
@GAS85 commented on GitHub (Apr 30, 2025):
👍
@gazanfarus commented on GitHub (Jun 11, 2025):
any updates?
@spansu commented on GitHub (Jul 17, 2025):
i have workaround
/data/nginx/custom/http_top.conf
mount custom /etc/nginx/conf.d/include/proxy.conf
./data/nginx/custom/_proxy.conf
with content
in advanced settings of proxy_host add
where you need it
@maxpowernz commented on GitHub (Aug 10, 2025):
Thought I would give NPM a try, mucked around with the other flaky settings then this comes up, pass for me. I don't get why so many people use and recommend it, it actually makes things harder.
@whc2001 commented on GitHub (Aug 11, 2025):
The only reason I use it before is because the WebUI. I switched to Caddy and never looked back as I need to edit config directly nevertheless because the bug.
@felipewnp commented on GitHub (Aug 21, 2025):
It's really sad that a problem like this is still around since 2021.
It's been over 4 years. It was very needed then, and still is now.
@jc21 How can we help? Could you point us to where the problem should/could be?
I don't know anything about JavaScript, but maybe I/we can try something.
@gudge25 commented on GitHub (Aug 27, 2025):
👍
i done it by commenting in conf file but it is a temporary solution
@Janhouse commented on GitHub (Sep 13, 2025):
Nothing temporary about it, this issue has been open since 2021.
To be honest, I'm not even sure why would you use the nginx-proxy-manager in the first place in 2025 if such a basic thing requires mounting custom config files. Might as well just configure nginx from scratch without the limited UI bloat. Especially now when Nginx supports acme for certificate retrieval natively.
@GrahamJenkins commented on GitHub (Oct 23, 2025):
I could have sworn I was able to do this in the past. Here's my experience:
400 Bad Request
Your browser sent a request that this server could not understand.
If I remove the custom location it works again, but no headers. If I can't handle these things inside npm easily via the GUI, I don't know why I'm even using it at this point, said as someone who has used it for more years than I can recall, because it's cleaner than hand mangling config files.
I don't know what caused this regression or why we can no longer be trusted to handle headers in the advanced section (I'm fairly certain I have done that in the past before "Enable websockets" was a feature) but this needs to be fixed. Not to be overly critical of open source software, but this feels like a significant regression/bug under the guise of a feature somewhere.
@felipewnp commented on GitHub (Oct 24, 2025):
Don't bother, this project died long ago.
I'm going to try traefik or something else to replace npm.
Open to suggestions.
Maybe we can start a how-to move away from npm and what your options are.
@gudge25 commented on GitHub (Oct 24, 2025):
i noticed there are forks like https://github.com/ZoeyVid/NPMplus
@felipewnp commented on GitHub (Oct 24, 2025):
I will absolutely try it out this weekend!
Thanks!
Em sex., 24 de out. de 2025, 09:59, Anton @.***>
escreveu:
@Janhouse commented on GitHub (Oct 24, 2025):
I am working on something similar for Traefik. The purpose is slightly different but the result is similar. https://github.com/Janhouse/traefik-proxy-admin
It's a bit early development there and I don't have the easy setup (docker compose up) ready yet, because I use it with my existing Traefik instance, but that could be done rather quickly.
@Stejsi commented on GitHub (Nov 4, 2025):
Same issue here. I cant rewrite Host in advanced tab & not even location tab.
v2.13.0 just have been released https://github.com/NginxProxyManager/nginx-proxy-manager/releases
but they said "No changes to Nginx/Openresty". Any thoughts?
@felipewnp commented on GitHub (Nov 4, 2025):
nginxProxyManager plus (https://github.com/ZoeyVid/NPMplus) , suggested above, is a good solution.
But I recommend that you migrate your hosts manually from npm to npm-plus, because it deploys modsecurity automatically for each host.
And modsecurity eats RAM like crazy the way it is implemented on npm-plus.