I have a few things that I host from my house. I have read that it’s better practice to route stuff through a VPS to not expose your home IP.
Here’s what I’ve done so far: VPN setup on VPS with successful routing of containers. Confirmed by using a CLI IP check within the container which returned the VPS IP. I used PiVPN because I know it and it’s easy to set up.
Where I got stuck: I pointed Nginx to the supposed IP:port of the connection, but couldn’t get it to load.
What should I do next?
Assuming your local service is accessible from the nginx server, you can proxy the request to it:
…where
10.100.100.2
is your local IP on the VPN and3000
is the local port your service is listening on, and80
is the public port your nginx server listens on. Everything that hits your nginx server athttp://yourserver.com/
will proxy back to your local service athttp://10.100.100.2:3000/
. Depending on what you’re hosting, you may need to add some things to the config.