Pommsn commited on
Commit
015c5fd
·
verified ·
1 Parent(s): 5fe7463

Update nginx.conf

Browse files
Files changed (1) hide show
  1. 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
- location / {
22
- root /var/www/html;
23
- try_files $uri $uri/ /index.html;
24
- index index.html;
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
- location /console {
 
 
 
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
- location /health-check {
43
- proxy_pass http://127.0.0.1:5001;
 
 
 
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
  }