Self-hosted HTTP tunnels with SSH and nginx 0 ▲ Vincent Bernat 2 hours ago · 6 min read1199 words · Tech · hide · 0 comments A friend wants to proofread your work-in-progress blog post, but its preview only runs on localhost:8080. Several tools can help. Some run as a commercial service, like ngrok or Cloudflare Quick Tunnels. Some are self-hostable but require a specific client, like frp or localtunnel. Some only require a plain SSH client but rely on a specific SSH server, like sish. Let’s implement a self-hosted solution with only OpenSSH and nginx! $ ssh -R 0:localhost:8080 http-over-ssh Allocated port 41535 for remote forward to localhost:8080 https://6J3jK1WmB15c6WmjW_X-Wg--1789928654@p41535.ssh.luffy.cx/ Basic setup First, we forward connections from a port on a remote server to your local service: $ ssh -N -R 0:localhost:8080 web02.luffy.cx Allocated port 41535 for remote forward to localhost:8080 When you specify 0 as the remote port, the server allocates a free port. Then, we configure nginx to proxy requests from https://p41535.ssh.luffy.cx to http://127.0.0.1:41535: server { listen 0.0.0.0:443… No comments yet. Log in to reply on the Fediverse. Comments will appear here.