Pommsn commited on
Commit
f9be9c8
·
verified ·
1 Parent(s): b64f28a

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +14 -0
nginx.conf CHANGED
@@ -1,19 +1,31 @@
1
  worker_processes auto;
 
2
  events {
3
  worker_connections 1024;
4
  }
 
5
  http {
6
  include /etc/nginx/mime.types;
7
  default_type application/octet-stream;
8
  sendfile on;
 
 
 
 
 
9
  server {
 
10
  listen 7860;
11
  server_name _;
 
 
12
  location / {
13
  root /var/www/html;
14
  try_files $uri $uri/ /index.html;
15
  index index.html;
16
  }
 
 
17
  location /v1 {
18
  proxy_pass http://127.0.0.1:5001;
19
  proxy_set_header Host $host;
@@ -21,11 +33,13 @@ http {
21
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
22
  proxy_set_header X-Forwarded-Proto $scheme;
23
  }
 
24
  location /console {
25
  proxy_pass http://127.0.0.1:5001;
26
  proxy_set_header Host $host;
27
  proxy_set_header X-Real-IP $remote_addr;
28
  }
 
29
  location /health-check {
30
  proxy_pass http://127.0.0.1:5001;
31
  }
 
1
  worker_processes auto;
2
+
3
  events {
4
  worker_connections 1024;
5
  }
6
+
7
  http {
8
  include /etc/nginx/mime.types;
9
  default_type application/octet-stream;
10
  sendfile on;
11
+
12
+ # เปิด Log ดูผลการทำงาน (ช่วย Debug ได้)
13
+ access_log /dev/stdout;
14
+ error_log /dev/stderr notice;
15
+
16
  server {
17
+ # บังคับให้ฟังที่ 7860
18
  listen 7860;
19
  server_name _;
20
+
21
+ # เสิร์ฟหน้าเว็บ (Web UI)
22
  location / {
23
  root /var/www/html;
24
  try_files $uri $uri/ /index.html;
25
  index index.html;
26
  }
27
+
28
+ # ส่งคำขอ API ไปหา Backend ที่ 5001
29
  location /v1 {
30
  proxy_pass http://127.0.0.1:5001;
31
  proxy_set_header Host $host;
 
33
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34
  proxy_set_header X-Forwarded-Proto $scheme;
35
  }
36
+
37
  location /console {
38
  proxy_pass http://127.0.0.1:5001;
39
  proxy_set_header Host $host;
40
  proxy_set_header X-Real-IP $remote_addr;
41
  }
42
+
43
  location /health-check {
44
  proxy_pass http://127.0.0.1:5001;
45
  }