Twan07 commited on
Commit
fa7ec17
·
verified ·
1 Parent(s): ca48e74

Update nginx/nginx.conf

Browse files
Files changed (1) hide show
  1. nginx/nginx.conf +8 -0
nginx/nginx.conf CHANGED
@@ -1,4 +1,9 @@
 
 
 
 
1
  http {
 
2
  client_body_temp_path /home/node/app/nginx/tmp/body;
3
  proxy_temp_path /home/node/app/nginx/tmp/proxy;
4
  fastcgi_temp_path /home/node/app/nginx/tmp/fastcgi;
@@ -6,12 +11,15 @@ http {
6
  server {
7
  listen 7860;
8
 
 
9
  location /api/ {
10
  proxy_pass http://127.0.0.1:3000;
11
  proxy_set_header Host $host;
12
  proxy_set_header X-Real-IP $remote_addr;
 
13
  }
14
 
 
15
  location / {
16
  proxy_pass http://127.0.0.1:5173;
17
  }
 
1
+ # ===== REQUIRED =====
2
+ events {}
3
+
4
+ # ===== HTTP =====
5
  http {
6
+ # Temp paths (chạy được với user node)
7
  client_body_temp_path /home/node/app/nginx/tmp/body;
8
  proxy_temp_path /home/node/app/nginx/tmp/proxy;
9
  fastcgi_temp_path /home/node/app/nginx/tmp/fastcgi;
 
11
  server {
12
  listen 7860;
13
 
14
+ # API → Backend
15
  location /api/ {
16
  proxy_pass http://127.0.0.1:3000;
17
  proxy_set_header Host $host;
18
  proxy_set_header X-Real-IP $remote_addr;
19
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20
  }
21
 
22
+ # Frontend
23
  location / {
24
  proxy_pass http://127.0.0.1:5173;
25
  }