this post was submitted on 30 Dec 2025
26 points (96.4% liked)

Selfhosted

54254 readers
652 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I'm looking into replacing cloudflare with a VPS running a reverse proxy over a VPN, however, every solution I see so far assumes you're running Docker, either for the external reverse proxy host or the services you're self hosting.

The VPS is already virtualized (perhaps actually containerized given how cheap I am) so I don't want to put Docker on top of that. The stuff I'm self hosting is running in Proxmox containers on a 15 year old laptop, so again, don't want to make a virtual turducken.

Besides, Docker just seems like a pain to manage. I don't think it was designed for use as a way to distribute turnkey appliances to end users. It was made for creating reproducible ephemeral development environments. Why else would you have to specify that you want a storage volume to persist across reboots? But I digress.

Anyway, I want to reverse proxy arbitrary IP traffic, not just HTTP/S Is that possible? If so, how?

My initial naive assumption is that you set up a VPN tunnel between the VPS and the various proxmox containers, with the local containers initiating the connection so port forwarding isn't necessary. You then set up the reverse proxy on the VPS to funnel traffic through the tunnel to the correct self-hosted container based on domain name and/or port.

you are viewing a single comment's thread
view the rest of the comments
[–] mhzawadi@lemmy.horwood.cloud 4 points 1 week ago* (last edited 1 week ago)

apt/yum/dnf install nginx, listen on public IP of VPS, use proxy_pass to forward to your internal IP

server {
    listen [::]:443 ssl;
    http2 on;
    server_name service.example.com;
    root /var/data/websites/holding;
    index index.php index.html index.htm;

    #SSL setting
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    add_header X-Clacks-Overhead "GNU Terry Pratchett";
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

    # access_log /var/log/nginx/service-access.log main;
    access_log off;

    location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Forwarded-Proto "https";
      proxy_set_header X-SECURE-REQUEST "true";
      proxy_set_header Host $http_host;
      proxy_pass http://192.168.1.2/; #IP of the service over the VPN
    }

}