Update nginx.conf
Browse files- nginx.conf +14 -42
nginx.conf
CHANGED
|
@@ -1,45 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
sendfile on;
|
| 11 |
-
|
| 12 |
-
access_log /dev/stdout;
|
| 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 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 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 |
}
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 7860;
|
| 3 |
+
|
| 4 |
+
# ส่งคำขอที่เป็น API ไปหาตัวสมองหลังบ้าน (พอร์ต 5001)
|
| 5 |
+
location ~ ^/(console/api|api|v1|files|install) {
|
| 6 |
+
proxy_pass http://127.0.0.1:5001;
|
| 7 |
+
proxy_set_header Host $host;
|
| 8 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 9 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
# ส่วนที่เหลือให้ดึงไฟล์หน้าเว็บจากโฟลเดอร์มาแสดง
|
| 12 |
+
location / {
|
| 13 |
+
root /app/web/out;
|
| 14 |
+
index index.html;
|
| 15 |
+
try_files $uri $uri/ /index.html;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
}
|