更新PM2配置并添加相关脚本

This commit is contained in:
2025-09-11 17:07:53 +08:00
parent 15b9cd406e
commit 7b237968b9
14 changed files with 228 additions and 1121 deletions

View File

@@ -1,10 +1,10 @@
# 结伴客后端Nginx配置文件
# SSL配置和webapi.jiebanke.com域名设置
# SSL配置和wapi.jiebanke.com域名设置
# HTTP服务器配置 - 重定向到HTTPS
server {
listen 80;
server_name webapi.jiebanke.com;
server_name wapi.jiebanke.com;
# 强制HTTPS重定向
return 301 https://$server_name$request_uri;
@@ -14,11 +14,11 @@ server {
server {
# 监听443端口并启用SSL
listen 443 ssl http2;
server_name webapi.jiebanke.com;
server_name wapi.jiebanke.com;
# SSL证书配置
ssl_certificate /etc/nginx/ssl/webapi.jiebanke.com.crt;
ssl_certificate_key /etc/nginx/ssl/webapi.jiebanke.com.key;
ssl_certificate /etc/nginx/ssl/wapi.jiebanke.com.crt;
ssl_certificate_key /etc/nginx/ssl/wapi.jiebanke.com.key;
# SSL优化配置
ssl_protocols TLSv1.2 TLSv1.3;
@@ -43,7 +43,7 @@ server {
# 代理配置
location / {
# 代理到Node.js后端服务
proxy_pass http://localhost:3200;
proxy_pass http://localhost:3310;
# 代理头信息配置
proxy_set_header Host $host;
@@ -71,21 +71,21 @@ server {
# 健康检查端点
location /health {
access_log off;
proxy_pass http://localhost:3200/health;
proxy_pass http://localhost:3310/health;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# API文档端点
location /api-docs {
proxy_pass http://localhost:3200/api-docs;
proxy_pass http://localhost:3310/api-docs;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# 静态资源缓存控制(如果后端有静态资源)
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
proxy_pass http://localhost:3200;
proxy_pass http://localhost:3310;
expires 1y;
add_header Cache-Control "public, immutable";
}