NginxProxyManager / NginxProxyManager/nginx-proxy-manager
[BUG] proxy_pass not adding square brackets for ipv6 causing all ipv6 ip's to 500 error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.2k
- Forks
- 3.9k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 20
Description
Checklist
- Have you pulled and found the error with
jc21/nginx-proxy-manager:latestdocker 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.
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the generated proxy host conf files and the included conf.d/include/proxy.conf, then reproduce the failure with an IPv6 forward address such as ::1:8096. Verify that the generated proxy_pass is valid for IPv6 and still works for IPv4, including after the proxy host configuration is edited.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, nginx, typescript
- Domain
- backend, devops, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100