The original post: /r/nginx by /u/Arthirion on 2024-10-09 19:30:51.

This question might have been asked a thousand times, but I can’t find a solution,. (And sorry for me English)

First of all my network

UDM Pro local Network: 192.168.1.0

Nginx running in docker on 192.168.1.20

PiVPN Network running in docker on 192.168.1.30 gives subnet 10.165.67.0/24

The VPN is only routing LAN network for 192.168.1.0/24 and 10.165.67.0/24.

Everything else is routing via normal internet connection. (I have it set up this way so I don’t overload the vpn)

Domain example.com routes to public WAN ip and nginx as reverse proxy routes it to the services. How do I setup so the domain is reachable only when on local network or connected to the vpn?

I tried:

allow 192.168.1.0/24; allow 10.165.67.0/24; deny all;

This works when really connected to 192.168.1.0/24 else deny but VPN connection doesn’t allow me to get to the domain.

At this moment I have no clue.