chore: 更新 nginx.conf 部署配置文件

This commit is contained in:
2024-12-22 18:29:00 +08:00
parent 899354a6e7
commit 4920d7b730

View File

@@ -40,9 +40,12 @@ http {
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ignore_client_abort on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://admin-server/;
}
@@ -82,6 +85,18 @@ http {
error_page 405 =200 https://$host$request_uri;
}
# /api/ 代理到后端(如果使用 /api/ 前缀代理而不使用 api 域名提供后端服务,可放开此配置)
#location /api/ {
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_ignore_client_abort on;
# proxy_set_header Host $http_host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://admin-server/;
#}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;