NginxProxyManager / NginxProxyManager/nginx-proxy-manager
Custom Nginx config not applied at container startup until a Proxy Host is edited and saved
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 using a valid custom Nginx configuration file, it is not loaded on container startup as expected.
I have added the following line in the file /data/nginx/custom/server_proxy.conf:
real_ip_header CF-Connecting-IP;
This directive is never applied when the container is started. I can confirm this by looking at the logs and inspecting the X-Real-IP header — it always contains Cloudflare’s IP.
However, as soon as I open any existing proxy host in the UI, click Edit, and then click Save (without changing anything), the configuration is reloaded and immediately works as expected. X-Real-IP then contains the real IP address of the client.
This looks like a bug where custom snippets are not loaded or not properly injected until a proxy host is re-saved.
Nginx Proxy Manager Version
v2.12.3
To Reproduce
Steps to reproduce the behavior:
-
Create a file
/data/nginx/custom/server_proxy.confwith content:real_ip_header CF-Connecting-IP; -
Start the container normally
-
Make a request to any proxy host (e.g. via curl) and observe the value of the
X-Real-IPheader → it's the Cloudflare IP -
Go to the UI, open any existing proxy host, click Edit, then click Save
-
Retry the request →
X-Real-IPnow contains the real client IP
Expected behavior
The configuration snippet /data/nginx/custom/server_proxy.conf should be taken into account immediately after starting the container, without requiring a manual Edit+Save in the UI.
Operating System
Ubuntu 24.04 LTS running Docker 24.0+ and Docker Compose v2.24.4
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 with container startup handling for /data/nginx/custom/server_proxy.conf, then compare it with the configuration reload path triggered by editing and saving a proxy host in the UI. Reproduce the issue with the provided real_ip_header directive and confirm that a fresh container applies it immediately without requiring an Edit and Save.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, nginx
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100