Skip to content

Commit 94befb2

Browse files
authored
🎸 Update web nginx conf (#90)
1 parent cb42dd9 commit 94befb2

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

w8t.conf

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,22 @@ server {
1818
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
1919

2020
resolver 8.8.8.8;
21-
#error Connection timed out and 504 error
22-
client_max_body_size 100m;
23-
fastcgi_connect_timeout 300;
24-
fastcgi_read_timeout 300;
25-
fastcgi_send_timeout 300;
26-
fastcgi_buffer_size 64k;
27-
fastcgi_buffers 4 32k;
28-
fastcgi_busy_buffers_size 64k;
29-
fastcgi_temp_file_write_size 64k;
3021

22+
# 优化超时设置,避免因请求处理时间过长导致超时
23+
proxy_connect_timeout 300;
24+
proxy_read_timeout 300;
25+
proxy_send_timeout 300;
26+
27+
# 优化缓冲区设置,避免大请求体导致缓冲区不足
28+
proxy_buffer_size 128k;
29+
proxy_buffers 4 256k;
30+
proxy_busy_buffers_size 256k;
31+
32+
# 关闭代理请求缓冲,确保大请求体直接传递到后端
33+
proxy_request_buffering off;
34+
35+
# 配置SSL和代理相关参数
3136
proxy_ssl_server_name on;
32-
proxy_read_timeout 240s;
3337
proxy_ssl_protocols TLSv1.2;
3438
proxy_pass http://w8t-service:9001;
3539
proxy_set_header Host $host;
@@ -39,10 +43,15 @@ server {
3943
proxy_set_header Content-Type "application/json";
4044
proxy_set_body $request_body;
4145
proxy_pass_request_headers on;
42-
proxy_request_buffering off;
4346
}
4447

48+
# 错误页面配置
4549
error_page 500 502 503 504 /500.html;
46-
client_max_body_size 20M;
50+
51+
# 全局请求体大小限制
52+
client_max_body_size 2050m;
53+
client_body_buffer_size 1024k;
54+
55+
# 保持连接超时时间
4756
keepalive_timeout 10;
4857
}

0 commit comments

Comments
 (0)