[GH-ISSUE #2829] Expand default Docker subnet CIDR to be more inclusive #1940

Closed
opened 2026-02-26 07:33:21 +03:00 by kerem · 2 comments
Owner

Originally created by @lyh16 on GitHub (Apr 14, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2829

Is your feature request related to a problem? Please describe.

The current "set_real_ip_from" that targets the Docker subnet points to the CIDR "172.16.0.0/12" as referenced below.

github.com/NginxProxyManager/nginx-proxy-manager@5f2576946d/docker/rootfs/etc/nginx/nginx.conf (L63)

However, due to the many possible ways of configuring Docker in the wild, many users often end up with a different subnet which is not covered by the above mentioned CIDR. This results in many users failing to acquire the real IP address of visitors using the default configurations. A quick Google search will reveal that quite a lot of users opt to modifying the CIDR for Docker.

Describe the solution you'd like

Change the CIDR for the Docker subnet from the current "172.16.0.0/12" to "172.0.0.0/8"

Describe alternatives you've considered

Manually modify the CIDR to match my needs via "docker exec -it".
However, even if I fix the CIDR to my likings by using "docker exec -it", pulling a newer version of the Docker image for the project will result in the resetting of the said customizations.

Additional context

Originally created by @lyh16 on GitHub (Apr 14, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2829 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Is your feature request related to a problem? Please describe.** <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> The current "set_real_ip_from" that targets the Docker subnet points to the CIDR "172.16.0.0/12" as referenced below. https://github.com/NginxProxyManager/nginx-proxy-manager/blob/5f2576946de7955f7318218bfd19570b8c857b76/docker/rootfs/etc/nginx/nginx.conf#L63 However, due to the many possible ways of configuring Docker in the wild, many users often end up with a different subnet which is not covered by the above mentioned CIDR. This results in many users failing to acquire the real IP address of visitors using the default configurations. A quick Google search will reveal that quite a lot of users opt to modifying the CIDR for Docker. **Describe the solution you'd like** <!-- A clear and concise description of what you want to happen. --> Change the CIDR for the Docker subnet from the current "172.16.0.0/12" to "172.0.0.0/8" **Describe alternatives you've considered** <!-- A clear and concise description of any alternative solutions or features you've considered. --> Manually modify the CIDR to match my needs via "docker exec -it". However, even if I fix the CIDR to my likings by using "docker exec -it", pulling a newer version of the Docker image for the project will result in the resetting of the said customizations. **Additional context** <!-- Add any other context or screenshots about the feature request here. -->
kerem 2026-02-26 07:33:21 +03:00
Author
Owner

@Zoey2936 commented on GitHub (Apr 14, 2023):

It is a very bad idea to trust public ips...

<!-- gh-comment-id:1509088842 --> @Zoey2936 commented on GitHub (Apr 14, 2023): It is a very bad idea to trust public ips...
Author
Owner

@lyh16 commented on GitHub (Apr 15, 2023):

It is a very bad idea to trust public ips...

Ahh... my bad. Yes, you are right. I somehow mistakenly thought that the mentioned issue was related to some kind of limitation on NPM's part. But it actually was a misconfiguration issue on my part. Compliance with RFC 1918 should be enough. Calling down issue and pull request.

<!-- gh-comment-id:1509444782 --> @lyh16 commented on GitHub (Apr 15, 2023): > It is a very bad idea to trust public ips... Ahh... my bad. Yes, you are right. I somehow mistakenly thought that the mentioned issue was related to some kind of limitation on NPM's part. But it actually was a misconfiguration issue on my part. Compliance with RFC 1918 should be enough. Calling down issue and pull request.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1940
No description provided.