sanbo
commited on
Commit
·
f2c1477
1
Parent(s):
776f171
update sth. at 2024-10-30 12:26:47
Browse files- nginx.conf +42 -26
nginx.conf
CHANGED
@@ -1,33 +1,49 @@
|
|
1 |
-
|
2 |
-
|
|
|
3 |
|
4 |
-
|
5 |
-
worker_connections 1024;
|
6 |
-
}
|
7 |
-
|
8 |
-
http {
|
9 |
include /etc/nginx/mime.types;
|
10 |
-
access_log
|
11 |
-
error_log
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
-
location / {
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
proxy_set_header
|
24 |
-
proxy_set_header
|
25 |
-
proxy_set_header
|
26 |
-
proxy_set_header
|
27 |
-
proxy_set_header
|
|
|
28 |
|
29 |
-
proxy_buffering
|
30 |
-
proxy_cache
|
31 |
-
}
|
32 |
-
}
|
33 |
}
|
|
|
1 |
+
events {
|
2 |
+
worker_connections 1024;
|
3 |
+
}
|
4 |
|
5 |
+
http {
|
|
|
|
|
|
|
|
|
6 |
include /etc/nginx/mime.types;
|
7 |
+
access_log /tmp/nginx_access.log;
|
8 |
+
error_log /tmp/nginx_error.log;
|
9 |
+
keepalive_timeout 65;
|
10 |
+
|
11 |
+
server {
|
12 |
+
listen 7860;
|
13 |
+
server_name localhost;
|
14 |
+
|
15 |
+
location /hf/ {
|
16 |
+
# 删除 /hf
|
17 |
+
rewrite ^/hf/(.*)$ /$1 break;
|
18 |
|
19 |
+
# 代理设置
|
20 |
+
proxy_pass http://127.0.0.1:8080;
|
21 |
+
proxy_http_version 1.1;
|
22 |
+
proxy_set_header Upgrade $http_upgrade;
|
23 |
+
proxy_set_header Connection "upgrade";
|
24 |
+
proxy_set_header Host $host;
|
25 |
+
proxy_set_header X-Real-IP $remote_addr;
|
26 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
27 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
28 |
|
29 |
+
# 支持流式输出
|
30 |
+
proxy_buffering off;
|
31 |
+
proxy_cache off;
|
32 |
+
}
|
33 |
|
34 |
+
location / {
|
35 |
+
# 默认的代理设置
|
36 |
+
proxy_pass http://127.0.0.1:8080;
|
37 |
+
proxy_http_version 1.1;
|
38 |
+
proxy_set_header Upgrade $http_upgrade;
|
39 |
+
proxy_set_header Connection "upgrade";
|
40 |
+
proxy_set_header Host $host;
|
41 |
+
proxy_set_header X-Real-IP $remote_addr;
|
42 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
43 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
44 |
|
45 |
+
proxy_buffering off;
|
46 |
+
proxy_cache off;
|
47 |
+
}
|
48 |
+
}
|
49 |
}
|