Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

My budget VPS had ports 80/443 blocked by NAT — here's the architecture that got my site online

Description and use

Problem: a public VPS blocked inbound traffic on ports 80/443 due to NAT. Solution: use an outbound Cloudflare tunnel (cloudflared), DNS‑01 ACME in Caddy, and Tailscale for private access. After configuration the site became reachable while SSH/DB stayed protected.

Problem

Public HTTP/HTTPS traffic could not reach the VPS because the provider’s 1:N NAT blocked inbound connections on ports 80/443.

Outcome

The site became reachable over HTTPS without paying for a public IP or opening inbound ports, while SSH and database access remained isolated to the Tailscale mesh.

Workflow

  • 1. Verify DNS and local firewall settings.
  • 2. Inspect network interfaces; discover eth0 has private 10.x.x.x address due to provider NAT.
  • 3. Confirm Caddy works locally with curl --resolve.
  • 4. Deploy cloudflared daemon to establish outbound tunnel to Cloudflare.
  • 5. Configure Cloudflare Tunnel ingress with originServerName to match Caddy’s SNI.
  • 6. Set up Caddy with DNS‑01 ACME (Cloudflare API) and reverse_proxy to localhost:3000.
  • 7. Enable Tailscale; bind SSH to tailscale0 interface only.
  • 8. Disable public inbound ports on eth0.
  • 9. Adjust Cloudflare settings: turn off Bot Fight Mode, set cache‑control for static assets.
  • 10. Create verification script to check services and local TLS.
  • 11. Test and iterate until stable.

Evidence

The interface (eth0) didn't carry the public IP shown on my invoice. Instead, it held an address in the carrier-grade/shared range: 10.x.x.x (or 100.64.x.x).

Source

The TLS handshake succeeded immediately. Caddy served the certificate, completed the negotiation, and returned the payload without complaint.

Source

Once the tunnel came up, requests through the browser threw immediate 502 Bad Gateway errors.

Source

  • Record date: 2026-11-02T09:59:07.150Z