Self-hosted HTTP tunnels with SSH and nginx
说明与用途
通过 SSH 反向隧道和 nginx 部署公共 HTTP 隧道,使外部客户端能够访问本地 Web 服务,而无需在网络中打开端口。
问题
Expose a local HTTP service to the internet without opening ports on the firewall.
结果
The local HTTP service becomes publicly accessible through a secure SSH tunnel and nginx reverse proxy, without exposing any ports on the private network.
工作流
- 1. Start an SSH reverse tunnel from the local server to a public SSH host:
ssh -R 80:localhost:8080 user@public-host - 2. Configure nginx on the public host to proxy requests to the tunnel endpoint.
- 3. Update DNS to point the desired domain to the public host's IP.
- 4. Verify external access via a browser or curl.
证据
Self-hosted HTTP tunnels with SSH and nginx
Start an SSH reverse tunnel from the local server to a public SSH host: ssh -R 80:localhost:8080 user@public-host
- 记录日期: 2026-10-04T20:41:04.667Z