Bind news app to localhost for reverse proxy

This commit is contained in:
wuyanwanwu
2026-08-17 20:32:41 +08:00
parent cc310283e4
commit 9490a1ce54
5 changed files with 8 additions and 2 deletions
+2
View File
@@ -46,6 +46,8 @@ ssh -N -L 15432:127.0.0.1:5432 <ssh-user>@<server-ip>
Linux 云服务器上推荐使用 `docker-compose.host-network.yml`SSH 隧道监听宿主机 `127.0.0.1:15432`,网页容器使用宿主机网络,`.env` 中填写 `PGHOST=127.0.0.1``PGPORT=15432`。这样不会把数据库隧道端口暴露到公网。模板见 `deploy/daily-news-db-tunnel.service.example`
网页服务可由 Nginx 代理到宿主机本地端口。使用 `docker-compose.host-network.yml` 时,覆盖配置会让网页只监听 `127.0.0.1:3100`;不要直接把 3100 暴露给公网。
## 配置
复制 `.env.example``.env`,再在服务器上填写实际值。仓库中不提交 `.env`、密码、SMTP 授权码或 SSH 私钥。