mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #1483] proxy_set_header X-Forwarded-Host in advance configuration doesn't take effect #1139
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#1139
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 @awsong on GitHub (Oct 14, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1483
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
I found that if I put
proxy_set_header X-Forwarded-Host $http_hostin my advance config it doesn't take effect. After looking at the saved config file I found that the statement is put outside of the
locationblock. If I manually move the statement intolocationblock it works fine.I also checked Custom Nginx Configurations section in the documentation, it seems that there is no option to let me customize inside
locationblock.Nginx Proxy Manager Version
2.9.9
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
Operating System
Additional context
@chaptergy commented on GitHub (Oct 14, 2021):
Yeah, that's how the advanced config works. I think there is some weird behavior in nginx where it doesn't apply any headers from outside the location block if there is even a single header set inside the location block. However you should be able to add a custom location
/where you can duplicate the stuff you need and add your custom header.@awsong commented on GitHub (Oct 14, 2021):
Yes you are right. I can add custom locate / in the settings and it works fine.
@denppa commented on GitHub (Nov 4, 2021):
Would you mind letting me know how to do it?
I want to access it at / and putting the lines at with that in mind, forwarded to the same ip and the parent proxy host does not solve the problem for me. Can I see what you did?
@awsong commented on GitHub (Nov 4, 2021):
Here is how I did it:

@denppa commented on GitHub (Nov 4, 2021):
Thank you, but apparently, my apps worked without needing to insert these but only enabling websocket. Not a professional so don't know the difference except a few lines being added. But if I do need some custom lines I will be sure to add them that way in the future.
Thank you so much!