Skip to content

[BUG] proxy_pass not adding square brackets for ipv6 causing all ipv6 ip's to 500 error #4487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
saxobroko opened this issue Apr 17, 2025 · 0 comments
Labels

Comments

@saxobroko
Copy link

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
When putting an ipv6 address into the forward ip box (using placeholder ip), with correct configuration results in a 500 internal server error. Upon digging into it through logs and what not, it's an issue with proxy.conf. So manually removing the line include conf.d/include/proxy.conf; from proxy_host conf files and adding the following to location /

proxy_pass http://[2403:9e00:3214:af00::20]:8096;
add_header X-Served-By $host;
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 $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;

Therefore based on this conclusion we can see that the default proxy_pass will allow ipv4 but will result in an error for ipv6. Additionally this temporary solution is incredibly unstable, because whenever the config is edited through NPM it reverts to the broken config.

Image

Nginx Proxy Manager Version
v2.12.3 but also got the error on v2.9.22

Expected behavior
proxy_pass should differentiate between ipv4 and ipv6 and automatically add the [ ] or the [ ] should be remobed from proxy_pass if the ip is ipv4.

Operating System
Using Docker on Windows

Additional context

Log with error:
2025/04/17 03:36:19 [error] 1617#1617: *47 invalid port in upstream "::1:8096/", client: 172.18.0.1, server: example.com, request: "GET / HTTP/2.0", host: "example.com"

the log clearly shows the url as ::1:8096 which is invalid as it should be [::1]:8096

Docker version: v4.40.0 also tested on v4.29.0

@saxobroko saxobroko added the bug label Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant