ReportRaahat CI commited on
Commit
7c429b6
Β·
1 Parent(s): 658e1ba

Deploy from GitHub: 79e79f6603bf40793e14bcc7a9de08372225138a

Browse files
Files changed (1) hide show
  1. nginx.conf +24 -16
nginx.conf CHANGED
@@ -2,18 +2,9 @@ server {
2
  listen 7860;
3
  server_name _;
4
 
5
- # Frontend (Next.js standalone)
6
- location / {
7
- proxy_pass http://127.0.0.1:3000;
8
- proxy_http_version 1.1;
9
- proxy_set_header Upgrade $http_upgrade;
10
- proxy_set_header Connection 'upgrade';
11
- proxy_set_header Host $host;
12
- proxy_set_header X-Real-IP $remote_addr;
13
- proxy_cache_bypass $http_upgrade;
14
- }
15
 
16
- # Backend API
17
  location /analyze {
18
  proxy_pass http://127.0.0.1:8000;
19
  proxy_set_header Host $host;
@@ -22,6 +13,11 @@ server {
22
  client_max_body_size 20M;
23
  }
24
 
 
 
 
 
 
25
  location /chat {
26
  proxy_pass http://127.0.0.1:8000;
27
  proxy_set_header Host $host;
@@ -37,28 +33,40 @@ server {
37
  client_max_body_size 20M;
38
  }
39
 
40
- location /mock-analyze {
 
41
  proxy_pass http://127.0.0.1:8000;
42
  proxy_set_header Host $host;
43
  }
44
 
45
- location /nutrition {
46
  proxy_pass http://127.0.0.1:8000;
47
  proxy_set_header Host $host;
48
  }
49
 
50
- location /exercise {
51
  proxy_pass http://127.0.0.1:8000;
52
  proxy_set_header Host $host;
53
  }
54
 
55
- location /docs {
56
  proxy_pass http://127.0.0.1:8000;
57
  proxy_set_header Host $host;
58
  }
59
 
60
- location /openapi.json {
61
  proxy_pass http://127.0.0.1:8000;
62
  proxy_set_header Host $host;
63
  }
 
 
 
 
 
 
 
 
 
 
 
64
  }
 
2
  listen 7860;
3
  server_name _;
4
 
5
+ # ── Backend API endpoints (specific paths only) ──
6
+ # These are the FastAPI endpoints that the frontend proxy routes call
 
 
 
 
 
 
 
 
7
 
 
8
  location /analyze {
9
  proxy_pass http://127.0.0.1:8000;
10
  proxy_set_header Host $host;
 
13
  client_max_body_size 20M;
14
  }
15
 
16
+ location /mock-analyze {
17
+ proxy_pass http://127.0.0.1:8000;
18
+ proxy_set_header Host $host;
19
+ }
20
+
21
  location /chat {
22
  proxy_pass http://127.0.0.1:8000;
23
  proxy_set_header Host $host;
 
33
  client_max_body_size 20M;
34
  }
35
 
36
+ # Backend nutrition/exercise API (POST only, called by Next.js proxy routes)
37
+ location /nutrition/ {
38
  proxy_pass http://127.0.0.1:8000;
39
  proxy_set_header Host $host;
40
  }
41
 
42
+ location /exercise/ {
43
  proxy_pass http://127.0.0.1:8000;
44
  proxy_set_header Host $host;
45
  }
46
 
47
+ location /docs {
48
  proxy_pass http://127.0.0.1:8000;
49
  proxy_set_header Host $host;
50
  }
51
 
52
+ location /openapi.json {
53
  proxy_pass http://127.0.0.1:8000;
54
  proxy_set_header Host $host;
55
  }
56
 
57
+ location /health {
58
  proxy_pass http://127.0.0.1:8000;
59
  proxy_set_header Host $host;
60
  }
61
+
62
+ # ── Everything else goes to Next.js frontend ──
63
+ location / {
64
+ proxy_pass http://127.0.0.1:3000;
65
+ proxy_http_version 1.1;
66
+ proxy_set_header Upgrade $http_upgrade;
67
+ proxy_set_header Connection 'upgrade';
68
+ proxy_set_header Host $host;
69
+ proxy_set_header X-Real-IP $remote_addr;
70
+ proxy_cache_bypass $http_upgrade;
71
+ }
72
  }