NginxProxyManager / NginxProxyManager/nginx-proxy-manager

Custom Nginx config not applied at container startup until a Proxy Host is edited and saved

Open
#4,472 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
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: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 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:

  1. Create a file /data/nginx/custom/server_proxy.conf with content:

    real_ip_header CF-Connecting-IP;
    
  2. Start the container normally

  3. Make a request to any proxy host (e.g. via curl) and observe the value of the X-Real-IP header → it's the Cloudflare IP

  4. Go to the UI, open any existing proxy host, click Edit, then click Save

  5. Retry the request → X-Real-IP now 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.