From ea763a247115ac07d3aa9192de8726f6087f73a8 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Tue, 6 Jan 2026 18:37:18 +0800 Subject: [PATCH] fix: use port 8081 for backend to avoid conflict with nginx --- railway/nginx.conf.template | 2 +- railway/start.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/railway/nginx.conf.template b/railway/nginx.conf.template index 32cd35a6..7d933f0c 100644 --- a/railway/nginx.conf.template +++ b/railway/nginx.conf.template @@ -16,7 +16,7 @@ server { # API 代理到后端 location /api/ { - proxy_pass http://127.0.0.1:8080/api/; + proxy_pass http://127.0.0.1:8081/api/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/railway/start.sh b/railway/start.sh index ecd90347..98853906 100644 --- a/railway/start.sh +++ b/railway/start.sh @@ -20,9 +20,9 @@ fi echo "📝 Generating nginx config for port $PORT..." envsubst '${PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/http.d/default.conf -# 启动后端(后台运行) -echo "🔧 Starting backend on port 8080..." -/app/nofx & +# 启动后端(后台运行,端口 8081 避免与 nginx 冲突) +echo "🔧 Starting backend on port 8081..." +API_SERVER_PORT=8081 /app/nofx & BACKEND_PID=$! # 等待后端启动