mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #3174] [RouterOS] a duplicate default server for 0.0.0.0:81 in /etc/nginx/conf.d/production.conf #2149
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nobodyspecial on GitHub (Sep 1, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3174
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
I'm trying to run the docker on a Mikotik RB5009 running RouterOS 7.11 and the container fails to start with error:
nginx: [emerg] a duplicate default server for 0.0.0.0:81 in /etc/nginx/conf.d/production.conf:3I can get the container running by deleting the file /etc/nginx/conf.d/dev.conf but I don't think this is the right way to get this working.
Nginx Proxy Manager Version
2.10.4 (ARM64)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
nginx starts
Operating System
RouterOS 7.11 (ARM64)
Additional context
I had this container running fine on this platform for months but a recent update changed something. I'm not sure if an NPM or RouterOS update is the cause. Also, the container runs without issue with the dev.conf file removed.
@broco2002 commented on GitHub (Sep 10, 2023):
Can confirm on Mikrotik RB5009 running RouterOS 7.11.2 using
jc21/nginx-proxy-manager:latest(v2.10.4)Workaround (deleting /etc/nginx/conf.d/dev.conf) still helps.
Seems like this file from the develop branch made it into the production build.
@nhan6310 commented on GitHub (Mar 8, 2024):
hello. Can you guide me to install it on mikrotik?
@Piloo116 commented on GitHub (Mar 18, 2024):
Hi guys. How did you remove /etc/nginx/conf.d/dev.conf ?
@broco2002 commented on GitHub (Mar 18, 2024):
I just used FTP and removed it that way. I use a USB stick for the files and went to
ftp://192.168.0.1/usb1-part1/docker/nginxpm/root/etc/nginx/conf.d/ and then deleted the dev.conf.
@itsbhanusharma commented on GitHub (Jul 1, 2024):
RB5009, This issue continues with latest release of RouterOS (7.15.2) and NPM (v2.11.3)
I remove the dev.conf file using the container shell access in winbox.
Stop and Start the container for changes to take effect and it gets online.
@Zignet64 commented on GitHub (Dec 7, 2024):
RouterOS (7.16.2) and NPM (v2.12.1)
same workaround needed
thanks @broco2002
@mrdrmmn commented on GitHub (Jan 2, 2025):
FWIW, this issues persistes in NPM v2.12.2. It looks like the dev build avoids this in the Dockerfile (
github.com/NginxProxyManager/nginx-proxy-manager@ec12d8f9bf/docker/dev/Dockerfile) via the following:RUN rm -f /etc/nginx/conf.d/production.conf
&& chmod 644 /etc/logrotate.d/nginx-proxy-manager
&& /tmp/install-s6 "${TARGETPLATFORM}"
&& rm -f /tmp/install-s6
&& chmod 644 -R /root/.cache
I do find a similar bit of code that seems it should do the equivalent in the prod Dockerfile (
github.com/NginxProxyManager/nginx-proxy-manager@ec12d8f9bf/docker/Dockerfile):RUN rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/frontend /etc/nginx/conf.d/dev.conf
&& chmod 644 /etc/logrotate.d/nginx-proxy-manager
So I'm not sure how /etc/nginx/conf.d/dev.conf is still showing up in the production build on hub.docker.com.
@Simon-CR commented on GitHub (Feb 12, 2025):
this is still happening as of feb 12th 2025.
@foegra commented on GitHub (Mar 9, 2025):
well, it's 1.5k open issues...
@FrankenLab commented on GitHub (Apr 15, 2025):
Same problem, workaround works, wasted a lot of time tracking this down and this issue's been open 1.5yrs....
@kcastner commented on GitHub (Aug 17, 2025):
Same issue today to me :) find out myself via logs - just deleted dev.conf because its most identical with production.conf. now it works. Next time, i should lookup the issue first :P
RouterOS: 7.19.2 Stable x86_64 CHR
NPM: v2.12.6
@mrdrmmn commented on GitHub (Aug 26, 2025):
So I think I can shed some light on this. I don't think this is truly an issue with nginx-proxy-manager, but rather an issue with overlayfs and the underlying filesystem. When layering images together like nginx-proxy-manager does, overlayfs relies on "whiteout" files to hide removed files. This allows multiple images to rely on shared layers even if it contains files what need to be removed in the final image.
From what I can tell, FAT32 and ZFS both have issues with overlayfs. In the case of routeros, you might avoid the problem by using ext4 as the underlying filesystem.
My workaround has been to create an empty file on the host, and then mount that over the problematic file in the container as a volume. Using the docker cli that looks something like this:
docker run -v /path/to/emptyfile:/etc/nginx/conf.d/dev.conf:ro
That all said, this problem could be addressed in the docker image creation process by flattening it. This link provides info on how that could be done:
https://stackoverflow.com/questions/22713551/how-to-flatten-a-docker-image
There are pros and cons to doing this. Specifically it would result in a smaller overall image for ngnix-proxy-manager, but if you have other images that share the same layers, your overall disk usage for docker images may go up.
In any case, just figured I would mention all of this to hopefully make someone's life a little easier... :)
@kcastner commented on GitHub (Aug 27, 2025):
@mrdrmmn i already tried that as mount. Does Not Work in routeros on my side.
Already tried mounting an empty file. Just got a script to remote it after an update.
Im using routeros as chr - i dont have an option to add additional storage. Is it possible to change the filesystem at routeros side?
@mrdrmmn commented on GitHub (Sep 1, 2025):
Hmm, strange that mounting an empty file didn't work. Sounds like there must be something else going on with RouterOS to make that not help as there should be no way for the os to see the contents of the file if you've successfully mounted over. My best guess is that for whatever reason the mount you are setting is not actually getting applied.
Here an example of testing the mount from the commandline using podman. It should work identically replacing 'podman' with 'docker':
I would be curious to see of you can reproduce this result on your side.
I might be able to try installing routeros in a vm to testing this myself in the next couple of days.