ReportRaahat / nginx.conf
ReportRaahat CI
Deploy from GitHub: 79e79f6603bf40793e14bcc7a9de08372225138a
7c429b6
server {
listen 7860;
server_name _;
# ── Backend API endpoints (specific paths only) ──
# These are the FastAPI endpoints that the frontend proxy routes call
location /analyze {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 120s;
client_max_body_size 20M;
}
location /mock-analyze {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location /chat {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 60s;
}
location /upload_and_chat {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 120s;
client_max_body_size 20M;
}
# Backend nutrition/exercise API (POST only, called by Next.js proxy routes)
location /nutrition/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location /exercise/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location /docs {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location /openapi.json {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location /health {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
# ── Everything else goes to Next.js frontend ──
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_bypass $http_upgrade;
}
}