Files
kami_frontend/deploy/nginx/default.conf
danial a00a360138 fix(deploy): 修复 Nginx 配置中的 DNS 解析设置
- 添加 Docker DNS 服务器解析配置,设置缓存有效期为 10 秒
- 配置解析超时为 5 秒,提升 DNS 解析稳定性
- 保证 Nginx 能够正确解析容器内域名请求
2025-11-18 15:02:50 +08:00

26 lines
753 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

resolver 127.0.0.11 valid=10s; # Docker DNS 服务器10秒过期 DNS 缓存
resolver_timeout 5s;
server {
listen 12400;
server_name localhost;
client_max_body_size 100M; # 全局设置,影响所有的 server 块
location / {
root /app;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://NGINX_CONFIG_URL:12401/api/;
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_connect_timeout 120;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_http_version 1.1;
}
}