Update nginx.conf
Browse files- nginx.conf +30 -0
nginx.conf
CHANGED
@@ -50,6 +50,36 @@ http {
|
|
50 |
listen [::]:7860 reuseport;
|
51 |
server_name localhost;
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
location / {
|
54 |
limit_req zone=one burst=20 nodelay;
|
55 |
limit_conn addr 10;
|
|
|
50 |
listen [::]:7860 reuseport;
|
51 |
server_name localhost;
|
52 |
|
53 |
+
|
54 |
+
|
55 |
+
location /hf/ {
|
56 |
+
rewrite ^/hf/(.*)$ /$1 break;
|
57 |
+
limit_req zone=one burst=15 nodelay;
|
58 |
+
limit_conn addr 5;
|
59 |
+
proxy_pass http://backend;
|
60 |
+
proxy_set_header Upgrade $http_upgrade;
|
61 |
+
proxy_set_header Connection "upgrade";
|
62 |
+
proxy_set_header Host $host;
|
63 |
+
|
64 |
+
# 清除敏感头部
|
65 |
+
proxy_set_header X-Forwarded-For "";
|
66 |
+
proxy_set_header X-Real-IP "";
|
67 |
+
proxy_set_header X-Direct-Url "";
|
68 |
+
proxy_set_header X-Forwarded-Port "";
|
69 |
+
proxy_set_header X-Ip-Token "";
|
70 |
+
proxy_set_header X-Request-Id "";
|
71 |
+
proxy_set_header X-Amzn-Trace-Id "";
|
72 |
+
proxy_set_header X-Forwarded-Proto "";
|
73 |
+
|
74 |
+
# 代理优化
|
75 |
+
proxy_buffering off;
|
76 |
+
proxy_cache off;
|
77 |
+
proxy_connect_timeout 60s;
|
78 |
+
proxy_send_timeout 60s;
|
79 |
+
proxy_read_timeout 60s;
|
80 |
+
error_page 503 =429 /429.html;
|
81 |
+
}
|
82 |
+
|
83 |
location / {
|
84 |
limit_req zone=one burst=20 nodelay;
|
85 |
limit_conn addr 10;
|