-
Notifications
You must be signed in to change notification settings - Fork 3k
Nginx proxy manager, limit access to local network via access list #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I ended up whitelisting the public IP address of my router, and somehow it covered all the devices within my network. |
Experiencing the same issue in the access list. |
Hopefully this will be implemented soon, with a fixed IP that doesn't really help. |
I am ending up with the same issue. What subnet did you use for external IP ? /32 ? |
Same issue. Unable to resolve it using internal single IP, subnet range, or external IP. |
Unfortunately there is nothing we can do about that. If you look into the access logs of your proxy host found at ports:
- target: 443
published: 443 # Outside port
mode: host
protocol: tcp
- target: 80
published: 80 # Outside port
mode: host
protocol: tcp |
@chaptergy Thanks for the summary. As I understand, by switching to host networking on my proxy manager container, I should be able to allowlist both the public IP of my network, and the private subnet(s) of my network. I have done both steps, and continue to see the same behavior. From
Allowlisting |
I can confirm this doesn't work. The compose snippet of chaptergy results in an error for me. If i try to whitelist my local ip subnet i get 403 on every page that uses the auth. |
Adding to the Custom Nginx Configuration should work. I did this, but to whitelist DDNS addresses as well as LAN access. For example you could: Hosts > Edit > Advanced and in Custom Nginx Configuration:
|
I figured it out. It does work with local access only. What I needed change is to allow the local docker IP range. By using "allow 172.18.0.0/16" in the access list, I could limit access to my containers only if connected through my docker wireguard VPN. Adding "allow 192.168.1.0/24" enables local network access. |
Seems to work for me ! |
You are connecting via docker WireGuard in the same docker network, right? Because I have WireGuard built-in, and it uses different network, so still needed the public IP address. |
Correct. I'm using wg-easy for my Wireguard setup to manage my users/credentials. wg-easy is using the same docker network as the rest of my containers including NginxProxyManager. |
Well i have NginxProxyManager on a other VirtualMachine than wireguard because i cant use Adguard + NginxProxyManager on one Machine. But the NginxProxyManger and Wireguard are both on the 192.168.178.0 network.. |
the only problem is: PUBLIC_IP can be changed and then, you need to change the configuration, right? |
Nevermind, I just found that I set the wrong value in WG_ALLOWED_IPS for wireguard. |
ive found using 1 instance NPM in the cloud, and 1 instance NPM in my lan, works best, and set my own dns recordsin router, public dns or hosts... helps with speed as in lan traffic doesnt got out my net interface and back in...if you use cloudflare for dns and dns with the api letsincrypt works even with lan IP's... |
The machine I'm running NPM on sits on both my local network and the internet, basically acts as my home router. My workaround to this issue is to firewalld off everything coming through from my WAN interface except for things like port 80 and 443, and then run this docker container with The only issue I hit is it seems NPM internally uses port 3000 for its API, which another container of mine was using. Once I switched ports for that container, everything seems to be functioning correctly now. |
Workaround OpenMediaVault docker:
By binding the port to the host address, I get the correct address of my systems in the local network. Conveniently, you can use the global environment (also for other docks): Global Environment:
Placeholder in Yaml:
|
This worked for me (i have a hairpin NAT). I didn't have to do the extra finangling. I removed the second line, and it allowed local access and prevented public access. I wouldn't recommend using public IP cuz that can change. |
so I am using cloudflare end the origin IP is changing all the time what I am saying: even local call to my domain: my.domain.com (domain.com is on cloudflare, "my" is only in LAN) requires internet to resolve the my.domain.com |
@homonto set up a local DNS (i.e. pi.hole is convenient) with your local server IP. In my case my router is the DHCP but I propagate the additional DNS IP to all systems in my network. |
I have Pihole, even 2: one on each VLAN: 192.168.1.23 and 192.168.100.31
But with these settings it is not working
Evidently the request comes from Cloudfare rather than from local DNS, but why? |
@homonto a ping ain't be logged by ngnix. You see a call to favicon.ico - that's probably your browser. You must ensure in your testing that your browser uses the DNS of your network. Search for DNS in the settings. Some use primarily external DNS for security reasons. Only when the external DNS has no match, do they check the internal ones, but because Cloudflare knows an external address for your domain that's not happening. Or call the site by curl or wget. |
@homonto maybe you missed my previous comment - did you check your browser settings? |
browser has no DNS settings and I checked on 3: Chrome, Firefox and Safari. And on mobile phone as well. |
Are you in the right place?
Checklist
jc21/nginx-proxy-manager:latest
docker image?Describe the bug
Recently I have been trying to limit the access of a self-hosted web service for "Streaming" to local network ONLY, with the aid of the nginx proxy manager.
My setup looks like the following:
Raspberry Pi 4 running Raspbian Os 64x running on a static IP (192.168.0.10).
docker & docker-compose & portainer are each properly installed.
raspberry running the following docker images with no ports conflicts: Nextcloud, ddclient, jc21/nginx-proxy-manager, pihole and finally this web service.
on the router (night hawk R7500), I set the IP address of the PiHole (in this case the Raspberry Pi) as DNS.
the Streaming website is a subdomain "movies.example.com". Where the domain "example.com" and the subdomain are enforced with self-signed SSL from the Nginx Proxy manger.
All the mentioned services are dockerized and nothing is installed on "bare metal"
The Nginx Proxy manager is installed with this tutorial.
The following (Screenshot 2) shows the view of the Nginx proxy manager access list IP Address Whitelist/Blacklist.
Screenshot 3 shows both the view of the SSL settings (3.3) and the view of the details section of the chosen host assigned with Authorization for Streaming.
v2.9.2
The text was updated successfully, but these errors were encountered: