This commit is contained in:
vet
2026-04-21 12:24:04 +07:00
parent 67ab5f5ba5
commit 6eb89ad2a9
15 changed files with 421 additions and 170 deletions

View File

@@ -8,7 +8,7 @@
#
# CORSchat-api:10008与 openim:10001/:10002已在应用内通过 openimsdk/tools/mw.CorsHandler
# 返回 Access-Control-Allow-Origin: *。若在此再用 add_header 追加 $http_origin浏览器会收到
# 「*, http://IP:5173」两个值并报错。故本配置不在 Nginx 层添加 CORS预检 OPTIONS 也交给上游处理。
# 「*, http://IP」两个值并报错。故本配置不在 Nginx 层添加 CORS预检 OPTIONS 也交给上游处理。
#
# 推荐外部访问入口https://pc-jack.imharry.work/
# 本 Nginx 仅监听 HTTP :80HTTPS 由外层 LB/CDN/网关终止后转发到本机 :80。
@@ -110,20 +110,10 @@ server {
return 200 "ok\n";
}
# PC Vite dev:web server.
# PC 静态站点dist.
location / {
proxy_pass http://127.0.0.1:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
proxy_buffering off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
root /app/pc/dist;
try_files $uri $uri/ /index.html;
}
}
@@ -218,3 +208,27 @@ server {
try_files $uri $uri/ /index.html;
}
}
server {
listen 80;
listen [::]:80;
server_name down-jack.imharry.work;
root /app/build-down/dist;
index index.html;
access_log /var/log/nginx/openim-build-down-access.log openim_pc_gateway;
error_log /var/log/nginx/openim-build-down-error.log warn;
client_max_body_size 100m;
location = /nginx-health {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location / {
try_files $uri $uri/ /index.html;
}
}