NginxProxyManager / NginxProxyManager/nginx-proxy-manager
Unable to correctly serve sub-paths using Nginx Proxy Manager
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
I am trying to set up services under sub-paths (e.g., https://mydomain.com/service1) using Nginx Proxy Manager (NPM). While subdomains work fine (e.g., service1.mydomain.com), sub-paths don’t seem to function correctly.
For example, I have configured https://mydomain.com/proxy to forward requests to http://nginx-proxy-manager:81, but when trying to access the service, the resources (CSS, JS, etc.) are still being requested from the root path (https://mydomain.com/) instead of https://mydomain.com/proxy/.
I have tried using custom locations, sub_filter, and proxy_redirect configurations, but the resources are not loading properly from the sub-path.
This issue seems to be similar to what others have experienced in discussion #1288 and this Reddit post, where sub-path forwarding doesn’t work as expected in NPM.
Nginx Proxy Manager Version
v2.11.3
To Reproduce
Steps to reproduce the behavior:
- Create a proxy host for
https://mydomain.com/proxy. - Set it to forward to
http://nginx-proxy-manager:81. - Access
https://mydomain.com/proxyin the browser. - Check the console for resource loading errors (
404 Not Found).
Expected behavior
Resources (CSS, JS, etc.) should load from https://mydomain.com/proxy/ and not from the root path.
Screenshots
This works.
But this doesn't work.
Operating System
Docker on Linux
Additional context
- I have tested this with custom locations in NPM.
- Also tried adding
sub_filterrules in Nginx to rewrite resource URLs and usingproxy_redirectto ensure any backend redirects retain the/proxyprefix. - Subdomains work fine, but sub-paths present this issue.
- Docker version 24.0.5, build ced0996
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
No repository file or test is named. Reproduce the proxy-host setup in the issue, inspect how Nginx handles /proxy and browser requests for CSS and JS, and compare it with the working subdomain case. Done means the proxied service and its assets load under /proxy/ without root-path 404s.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, nginx
- Domain
- devops, infrastructure, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100