Please use this template for troubleshooting questions.
My issue: I have an internal network of 192.168.2.x, my nginx is on .2.2. I have some websites that I do NOT want to be accessed from the internet. My internet router is on .2.1. How do I deny traffic coming through the router since the router address is not the source address?
How I encountered the problem:
Solutions I’ve tried: various allow / deny configurations.
Deployment environment: Latest nginx on debian 13.
I’d additionally make sure that your inbound wan->lan port forwarding applies DNAT only and that SNAT/masquerade is not applied, otherwise, nginx will see your router’s IP as the source => allow rule will incorrectly match