Windows部署: 后端端口统一改为8080

This commit is contained in:
2026-09-11 16:34:30 +08:00
parent 064dbb7561
commit fc51641700
4 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -6,7 +6,7 @@
- [`deploy/windows/install-nssm-services.ps1`](../deploy/windows/install-nssm-services.ps1):用 NSSM 把前后端注册为 Windows 服务
- [`requirements/production-windows.txt`](../requirements/production-windows.txt):Windows 专用生产依赖(用 waitress 替代不支持 Windows 的 gunicorn)
架构:浏览器 → Nginx for Windows(TLS 终止)→ { Next.js(127.0.0.1:3000) | waitress(127.0.0.1:8000) },
架构:浏览器 → Nginx for Windows(TLS 终止)→ { Next.js(127.0.0.1:3000) | waitress(127.0.0.1:8080) },
两个进程均由 NSSM 注册为 Windows 服务,实现开机自启 + 崩溃自动重启。
## 1. 服务器基础环境
@@ -124,7 +124,7 @@ Get-Service wagtailcms-*
服务日志分别写在 `C:\wagtailcms\logs\` 和 `C:\wagtailcms\frontend\logs\`(自动按 10MB 滚动)。
> `serve-backend.ps1` 内部用 `waitress-serve` 监听 `127.0.0.1:8000`,`wagtailcms-frontend`
> `serve-backend.ps1` 内部用 `waitress-serve` 监听 `127.0.0.1:8080`,`wagtailcms-frontend`
> 服务直接执行 `npm run start`(Next.js 默认监听 3000)。两者都设置了
> `Start=SERVICE_AUTO_START`(开机自启)+ `AppRestartDelay=5000`(崩溃 5 秒后自动重启)。
@@ -176,7 +176,7 @@ Windows 上常用方案:
New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound -LocalPort 80 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "HTTPS" -Direction Inbound -LocalPort 443 -Protocol TCP -Action Allow
```
云服务商控制台安全组同样放行 80/443;`8000`/`3000` 只监听 `127.0.0.1`,无需(也不应该)对公网开放。
云服务商控制台安全组同样放行 80/443;`8080`/`3000` 只监听 `127.0.0.1`,无需(也不应该)对公网开放。
## 12. 验证清单