Update nginx.conf
Browse files- nginx.conf +7 -6
nginx.conf
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
server {
|
| 2 |
listen 7860;
|
| 3 |
-
|
| 4 |
-
#
|
| 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 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
}
|
| 17 |
}
|
|
|
|
| 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-Real-IP $remote_addr;
|
| 9 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 10 |
}
|
| 11 |
|
| 12 |
+
# ถ้าเรียกหน้าเว็บปกติ ให้ส่งไปพอร์ต 3000
|
| 13 |
location / {
|
| 14 |
+
proxy_pass http://127.0.0.1:3000;
|
| 15 |
+
proxy_set_header Host $host;
|
| 16 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 17 |
}
|
| 18 |
}
|