Create nginx.conf
Browse files- nginx.conf +23 -0
nginx.conf
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
events { worker_connections 1024; }
|
| 2 |
+
|
| 3 |
+
http {
|
| 4 |
+
include mime.types;
|
| 5 |
+
default_type application/octet-stream;
|
| 6 |
+
|
| 7 |
+
server {
|
| 8 |
+
listen 7860; # Nginx 监听 Hugging Face 的端口
|
| 9 |
+
|
| 10 |
+
location / {
|
| 11 |
+
proxy_pass http://127.0.0.1:8317; # 转发到程序的真实端口
|
| 12 |
+
proxy_set_header Host $host;
|
| 13 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 14 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 15 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 16 |
+
|
| 17 |
+
# 支持 WebSocket (如果程序有需要)
|
| 18 |
+
proxy_http_version 1.1;
|
| 19 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 20 |
+
proxy_set_header Connection "upgrade";
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
}
|