I am probably unnecessarily paranoid. But still also I think paranoid isn't too bad when it comes to security.
I have a web server running on a VPS. I run zerotier on all my VPS and my home machines. I then use Letsencrypt to run a https webserver.
Therefore, I have a DNS entry pointing to my webserver with the zerotier VPS address:
myzerotier_webserver.mydomain.com 172.29.70.241
.
Now, I'd like to restrict access to my webserver to only participants in the zerotier network.
I tried this:
listen 127.0.0.1:443 ssl http2;
listen 172.29.0.0:443 ssl http2;
But this doesn't seem to work accessing this server from my connected home laptop entering myzerotier_webserver.mydomain.com
in the browser.
I also tried by replacing 172.29.0.0
with the actual IP address of the VPS, e.g. 172.29.70.241
.
But it also didn't work.
Is this actually doable in some way? Should I do it differently maybe? Maybe it should work so the issue is some other configuration I got wrong?
listen <ip>:<port>
. If this doesn't work as expected, a line from the access log would be helpful.docker compose
: 192.168.80.1. Which means even the accepted solution actually doesn't work. In order to make it work, I had to extract nginx to run on the host, not in a container. Now I can filter by VPN address AND I can use multipleserver
instances of nginx listening to the same ports without interfering.