demo / nginx.conf
AIVLAD's picture
feat: add React frontend with nginx reverse proxy
f75bff1
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 7860;
server_name _;
root /usr/share/nginx/html;
index index.html;
# API proxy to Django backend
location /api {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# SPA fallback - serve index.html for all routes except /api
location / {
try_files $uri $uri/ /index.html;
}
}
}