Update nginx.conf
Browse files- nginx.conf +17 -18
nginx.conf
CHANGED
|
@@ -13,34 +13,33 @@ http {
|
|
| 13 |
error_log /dev/stderr notice;
|
| 14 |
|
| 15 |
server {
|
| 16 |
-
# ฟังที่พอร์ต 7860 ซึ่ง Hugging Face จะเปิดให้เข้าได้ผ่าน URL หลัก
|
| 17 |
listen 7860;
|
| 18 |
server_name _;
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
# ส่งคำขอ API ไปหา Backend พอร์ต 5001
|
| 28 |
-
location /v1 {
|
| 29 |
-
proxy_pass http://127.0.0.1:5001;
|
| 30 |
proxy_set_header Host $host;
|
| 31 |
proxy_set_header X-Real-IP $remote_addr;
|
| 32 |
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 33 |
proxy_set_header X-Forwarded-Proto $scheme;
|
| 34 |
}
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
proxy_pass http://127.0.0.1:5001;
|
| 38 |
proxy_set_header Host $host;
|
| 39 |
proxy_set_header X-Real-IP $remote_addr;
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
}
|
| 46 |
}
|
|
|
|
| 13 |
error_log /dev/stderr notice;
|
| 14 |
|
| 15 |
server {
|
|
|
|
| 16 |
listen 7860;
|
| 17 |
server_name _;
|
| 18 |
|
| 19 |
+
# =====================================================
|
| 20 |
+
# แก้หน้าแรก (Root /): ส่งไปหา /setup (หน้าตั้งค่าของ Dify)
|
| 21 |
+
# =====================================================
|
| 22 |
+
location = / {
|
| 23 |
+
proxy_pass http://127.0.0.1:5001/setup;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
proxy_set_header Host $host;
|
| 25 |
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
| 26 |
proxy_set_header X-Forwarded-Proto $scheme;
|
| 27 |
}
|
| 28 |
+
|
| 29 |
+
# =====================================================
|
| 30 |
+
# ส่งทุกคำสั่ง API และหน้าจออื่นๆ ไปหา Python Backend
|
| 31 |
+
# =====================================================
|
| 32 |
+
location / {
|
| 33 |
proxy_pass http://127.0.0.1:5001;
|
| 34 |
proxy_set_header Host $host;
|
| 35 |
proxy_set_header X-Real-IP $remote_addr;
|
| 36 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 37 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 38 |
+
|
| 39 |
+
# อนุญาตให้ใช้ WebSocket (สำคัญสำหรับคุยกับ AI แบบ Stream)
|
| 40 |
+
proxy_http_version 1.1;
|
| 41 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 42 |
+
proxy_set_header Connection "upgrade";
|
| 43 |
}
|
| 44 |
}
|
| 45 |
}
|