Skip to content

Invalid proxy_pass with $upstream variable #1460

@rmartcas

Description

@rmartcas

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
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:

___location ^~ /jenkins/ {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.01:8080/jenkins/;
}

After:

___location ^~ /jenkins/ {
set $upstream http://127.0.0.01:8080/jenkins/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $upstream;
}

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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:
image

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions