Files
easyai-ai-gateway/docker/nginx.conf
T
chengcheng e9f287971a
ci / verify (pull_request) Failing after 6m43s
fix(auth): 为登录链路增加有界超时
为 PostgreSQL 连接、就绪检查和本地登录设置分层超时,数据库不可用时返回稳定 503 错误码并记录无凭据的连接池统计。

前端登录在 10 秒后取消请求并兼容调用方 AbortSignal,Nginx 登录精确路由限制上游为 15 秒,同时更新 OpenAPI 和回归测试。
2026-07-21 11:14:35 +08:00

67 lines
1.8 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 200m;
location = /gateway-api {
return 308 /gateway-api/;
}
# RFC 8935 receiver: exact path, no redirect, short bounded upstream timeout.
location = /api/v1/security-events/ssf {
client_max_body_size 64k;
client_body_buffer_size 64k;
client_body_timeout 5s;
proxy_http_version 1.1;
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_set_header Connection "";
proxy_connect_timeout 3s;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
proxy_redirect off;
proxy_pass http://api:8088;
}
# Metrics stay on the API's monitoring network and are not exposed by Web.
location = /gateway-api/metrics {
return 404;
}
location = /gateway-api/api/v1/auth/login {
proxy_http_version 1.1;
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_set_header Connection "";
proxy_connect_timeout 3s;
proxy_read_timeout 15s;
proxy_send_timeout 15s;
proxy_redirect off;
proxy_pass http://api:8088/api/v1/auth/login;
}
location /gateway-api/ {
proxy_http_version 1.1;
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_set_header Connection "";
proxy_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_pass http://api:8088/;
}
location / {
try_files $uri $uri/ /index.html;
}
}