mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #1460] Invalid proxy_pass with $upstream variable #1126
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#1126
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 @rmartcas on GitHub (Oct 5, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1460
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
After proxy host config update, custom locations fails.
Checking the proxy host number.conf before and after the update i can see this difference:
Before:
After:
The same ocurrs with all other custom locations in the proxy host.
Nginx Proxy Manager Version
v2.9.9
To Reproduce
Steps to reproduce the behavior:
Expected behavior
With the old proxy_pass http://.... works fine, but with variable set $upstream at begining of the location the proxy don't loads all related paths with custom locations
Screenshots
With new $upstream variable:

With old config or reventing the .conf manually and reloading nginx:

Operating System
Linux AMI
Additional context
Proxy host config files, before and after the last update.
proxy_conf_new.conf.txt
proxy_conf_old.conf.txt
@rmartcas commented on GitHub (Oct 5, 2021):
Some info from stackoverflow that could help.
https://stackoverflow.com/questions/46230270/nginx-using-variable-in-proxy-pass-breaks-routing
@chaptergy commented on GitHub (Oct 5, 2021):
Unfortunately I am not able to find a way which would allow both the usage of a variable for skipping domain caching and a working and generalizable path inclusion.
As the StackOverflow question also describes,
proxy_passexpects a full url if it includes a variable, so no path is added to the host. This behaviour is also described in this article.I have tried just adding the
$request_urivariable to no avail, I've also tried using the regex location name which did not work and would not generalize well, and I've also tried a suggestion from a forum to userewritewhich did not work either.Unless some fix is found which would fix both this issue and the one described in the commit, we would have to decide which issue is more relevant, either this one or the caching issue. I would personally say this issue is more relevant and to revert commit
github.com/jc21/nginx-proxy-manager@6c1ae77a2a. @jc21Though the changes added in the commit could possibly also mitigate the issue raised in https://github.com/jc21/nginx-proxy-manager/issues/633.
@chaptergy commented on GitHub (Nov 14, 2021):
The changes have been reverted and should be included in the next release when it comes (2.9.13)
@kabadisha commented on GitHub (Mar 19, 2023):
@shakamus & @chaptergy I took a look at this problem and think I have come up with a solution that works:
https://github.com/NginxProxyManager/nginx-proxy-manager/pull/2672
If you could take a look and test, that would be awesome :-)