NginxProxyManager / NginxProxyManager/nginx-proxy-manager
Feature Request: Add environment variable for Base Path / Subpath support (e.g., BASE_PATH)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.2k
- Forks
- 3.9k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 20
Description
Is your feature request related to a problem? Please describe.
Currently, Nginx Proxy Manager (NPM) assumes it is always running on the root directory (/) of a domain or subdomain. When trying to host NPM behind another reverse proxy (like YARP, Traefik, or an upstream Nginx) under a specific subpath (e.g., https://mydomain.com/npm), the Admin UI completely breaks.
This happens because all asset paths (JS, CSS) and API calls are hardcoded to the root (e.g., /assets/main.js or /api/). The browser tries to fetch them from the root of the main proxy instead of the subpath, resulting in 404 Not Found errors.
Describe the solution you'd like
It would be amazing to have an environment variable—similar to Kibana's SERVER_BASEPATH or Grafana's root_url—such as BASE_PATH or APP_BASE_URL.
When this variable is set (e.g., BASE_PATH=/npm):
- The frontend should prepend this path to all static asset requests.
- The UI should send all API requests to
/<BASE_PATH>/api/...instead of/api/.... - The backend routing should respect this prefix.
Describe alternatives you've considered
- Using subdomains: While using
npm.mydomain.comworks, it is not always feasible due to corporate network constraints, SSL certificate limitations, or strict domain policies where only a single domain with subpaths is allowed. - URL Rewriting / Response Transformation: Trying to rewrite the response body dynamically on the upstream proxy to inject the subpath is incredibly brittle and breaks easily with new updates.
Additional context
Many popular DevOps and containerized tools (like Kibana, Grafana, Portainer, and Gitea) support base path configuration natively out of the box via environment variables. Adding this feature would greatly improve NPM's flexibility in complex network architectures and enterprise environments.
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
The issue names no files, tests, or entry points. Start by locating where the frontend builds asset and API URLs, then find the backend routing configuration; verify how both layers can consume BASE_PATH. Done means the Admin UI assets, API requests, and backend routes work correctly under a configured subpath without breaking root deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nginx, typescript
- Domain
- api, full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100