mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #1380] FORBIDDEN: Despite Documentation! Creating "Local only" Access List, requires PUBLIC IPs ONLY #1085
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#1085
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 @hakunamatata97k on GitHub (Sep 6, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1380
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
Despite what the documentation say, adding local IPs, subnets, and local gateway is NOT working in my case!.
i used the following
docker-compose.yamlfile to do the installation:The conf file:
Nginx Proxy Manager Version
I pulled the latest docker image:
docker pull jc21/nginx-proxy-manager:latestExpected behavior
its expected that the page would load without getting 403 ERROR forbidden!!!.
Screenshots
Operating System
Raspbian Os 64x, docker & Portainer.
Additional context
@PlasmatikSteak commented on GitHub (Sep 7, 2021):
Possible duplicate
https://github.com/jc21/nginx-proxy-manager/issues/1279
@hakunamatata97k commented on GitHub (Sep 7, 2021):
In my situation, the NPM gives the following error message and doesn't recognize that the client is connected locally:
2021/09/07 17:03:09 [error] 3626#3626: *5038 access forbidden by rule, client: 95.x.x.x, server: subdomain.mydomain.com, request: "GET / HTTP/1.1", host: "subdomain.mydomain.com"the 95.x.x.x being the public IP of the router!. So NPM is not recognizing that I'm in the local network!!!!.
I can't add the public IP of my router because it will be dynamically changed by the ISP.
That's how these both issues differ.
@BobWs commented on GitHub (Dec 17, 2021):
Did you find a solution for your "local access" problem? I have a similar problem, NPM is not able to access only the local nework without going through the "outside" internet. Their are some subdomains that would rather keep outside acces.
How to solve this?
@msiemens commented on GitHub (Dec 18, 2021):
I struggled with this too, but after thinking about this for a while I'm fairly certain this issue has nothing to do with NPM itself but rather with the router/networking setup.
Basically, the typical setup (as far as I can tell) uses port forwarding configured in one's home router and a DNS entry some domain that uses the router's public IP (e.g. using some dynamic DNS service). As far as I understand in this setup NPM will never be able to receive the local IP address because every connection to NPM resolves to the router's IP which in turn creates a connection to NPM. So it absolutely makes sense to see the router's public IP address in the logs as it's where the connection is originating from NPM's point of view.
To be honest, I think there's nothing NPM can do to fix this. It does exactly what it's made for: configure a NGINX instance as a reverse proxy. But NPM can't configure your local network to route requests directly to itself without going through the router's public IP and port forwarding.
See also: https://github.com/jc21/nginx-proxy-manager/issues/1105#issuecomment-950384265
@almostserious commented on GitHub (Apr 14, 2022):
So, I was trying to figure out the same. I wanted local access to some URLs only.
And indeed, with normal settings this will not work because NPM will always receive the Public IP as the traffic is routed through a DNS thats located outside your network.
However, I just found a way to make it work for me.
I am using Adguard as my DNS.
Within there, I can specify DNS Rewrites.
So adding the URL I want to be only available locally and rewriting this to the IP of NPM makes NPM receive the local IPs asking for access.
This results in the Access List working as intended.
This should work with any locally hosted DNS service that allows you to do custom routes.
@BobWs commented on GitHub (Apr 15, 2022):
Interesting find! I’m also using Adguard, so could you please explain it a little more in detail how to do it. Could you please give an example how to configure adguard.
@almostserious commented on GitHub (Apr 15, 2022):
Sure thing, its pretty simple.
Put your desired URL, or a wildcard and put it in a DNS rewrite in Adguard. i.e.: *.myddns.duckdns.org and simply rewrite it to the IP where NPM is running in your local network.
That should be the same IP that you also forwarded port 80 and 443 in your router.
You can find this in Adguard under Filter & DNS Rewrite
@BobWs commented on GitHub (Apr 16, 2022):
@almostserious thanks for sharing I will give it a try!
@BobWs commented on GitHub (Apr 18, 2022):
Unfortunately it isn’t working for me. I have configured exactly as you described, but it isn’t working.
Could it be related to the fact that I have setup Adguard with macvlan? I have read that macvlan can’t communicate with the host due some security limitations of Docker.
@Nickjones818 commented on GitHub (Sep 7, 2022):
To provide some feedback for anyone with ability to perform "Host Overrides"


You can assign an access list of just your local subnet as shown...
But you need to be able to adjust your router/firewall DNS settings (in my case using PFSense DNS Resolver, located at the bottom of that page) to override the IP of the DNS Request your trying to make

in this example i have Dynamic DNS setup and a Godaddy Domain name all being pointed back to my home webserver being hosted on Unraid. Some are exposed to the public, others just local subnet. In my example of local only, i just simply created a made up website name (myembyserver.network), and added that to the host override section of PFsense. The name resolves on my local network only, is routed through NPM perfectly.
@github-actions[bot] commented on GitHub (Mar 5, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@github-actions[bot] commented on GitHub (Apr 18, 2025):
Issue was closed due to inactivity.