Spaces:
Sleeping
Sleeping
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| error_log /var/log/nginx/error.log warn; | |
| events { | |
| worker_connections 256; | |
| } | |
| http { | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| keepalive_timeout 65; | |
| # Logging | |
| access_log /var/log/nginx/access.log; | |
| # Gzip compression | |
| gzip on; | |
| gzip_types text/plain text/css application/json application/javascript text/xml; | |
| server { | |
| listen 7860; | |
| server_name _; | |
| # Max upload size (for seed documents) | |
| client_max_body_size 50M; | |
| # Flask backend API | |
| location /api/ { | |
| proxy_pass http://127.0.0.1:5001; | |
| 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; | |
| # Long timeout for simulations (up to 10 minutes) | |
| proxy_read_timeout 600s; | |
| proxy_connect_timeout 30s; | |
| proxy_send_timeout 600s; | |
| } | |
| # Health check endpoint | |
| location /health { | |
| proxy_pass http://127.0.0.1:5001; | |
| proxy_set_header Host $host; | |
| proxy_read_timeout 10s; | |
| } | |
| # Vue SPA (static files) | |
| location / { | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| try_files $uri $uri/ /index.html; | |
| } | |
| } | |
| } | |