hstz commited on
Commit
4c875ea
·
verified ·
1 Parent(s): 4ecb914

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +8 -7
nginx.conf CHANGED
@@ -10,9 +10,11 @@ events {
10
  http {
11
  # 基础设置
12
  sendfile on;
13
- tcp_nodelay on;
14
- tcp_nopush off;
15
-
 
 
16
  # MIME类型
17
  include /etc/nginx/mime.types;
18
 
@@ -23,8 +25,8 @@ http {
23
  client_header_timeout 30s;
24
 
25
  # 连接优化
26
- keepalive_timeout 65;
27
- keepalive_requests 100;
28
 
29
  # 压缩设置
30
  gzip on;
@@ -34,7 +36,6 @@ http {
34
  gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
35
 
36
  # 缓存设置
37
- proxy_buffering off;
38
  proxy_request_buffering off;
39
 
40
  # 日志配置
@@ -45,7 +46,7 @@ http {
45
  upstream backend {
46
  least_conn;
47
  server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
48
- keepalive 32;
49
  }
50
 
51
  server {
 
10
  http {
11
  # 基础设置
12
  sendfile on;
13
+ tcp_nodelay on; # 开启 TCP_NODELAY
14
+ tcp_nopush on; # 开启 TCP_NOPUSH
15
+ proxy_buffering off; # 关闭代理缓冲
16
+ chunked_transfer_encoding on; # 启用分块传输编码
17
+
18
  # MIME类型
19
  include /etc/nginx/mime.types;
20
 
 
25
  client_header_timeout 30s;
26
 
27
  # 连接优化
28
+ keepalive_timeout 120; # 设置保持连接的超时时间
29
+ keepalive_requests 100; # 客户端保持连接请求的数量
30
 
31
  # 压缩设置
32
  gzip on;
 
36
  gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
37
 
38
  # 缓存设置
 
39
  proxy_request_buffering off;
40
 
41
  # 日志配置
 
46
  upstream backend {
47
  least_conn;
48
  server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
49
+ keepalive 64;
50
  }
51
 
52
  server {