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?

  • catloaf@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    21 hours ago

    VPN setup on VPS with successful routing of containers. Confirmed by using a CLI IP check within the container which returned the VPS IP

    If you want to route traffic from the VPS over the VPN, and the check returned the IP address of the VPS, this confirms it is not working. You need to configure your VPS to route traffic over the VPN. Personally, I’ve done this in the reverse direction (routing local qbittorrent to a public VPN) with gluetun.

    • jws_shadotak@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      21 hours ago

      I think you got it reversed. I want the container traffic to go through the VPN to the VPS and I want the reverse proxy on the VPS to point to that container.

      I want the website (hosted at my house) to be accessible through the VPS so my IP isn’t directly exposed.

      • catloaf@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        20 hours ago

        You’ve confirmed I’ve understood it correctly. Someone on the Internet requests your site. They reach your VPS with nginx. So far so good. Now, how does nginx know how to reach the upstream service?

            • jws_shadotak@sh.itjust.worksOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              17 hours ago

              For the services already hosted by the VPS, I just point service.web.site to the appropriate localhost:port.

              My hiccup is that the VPN software (pivpn) gives me an internal IP for the clients but pointing Nginx to that IP doesn’t work.

              • catloaf@lemm.ee
                link
                fedilink
                English
                arrow-up
                1
                ·
                15 hours ago

                The nginx host is the VPN client in this case, so it’d be connecting to itself. You need to point it to the host on the VPN server side network.