# Remove or comment out `user` directive if it's elsewhere # user nginx; error_log /app/logs/error.log warn; access_log /app/logs/access.log; client_body_temp_path /app/tmp/body; proxy_temp_path /app/tmp/proxy; fastcgi_temp_path /app/tmp/fastcgi; uwsgi_temp_path /app/tmp/uwsgi; scgi_temp_path /app/tmp/scgi; server { listen 7860; # Increase file upload size limit for document uploads client_max_body_size 100M; client_body_timeout 300s; client_header_timeout 300s; # Root directory for the React app root /usr/share/nginx/html; index index.html index.htm; # Handle client-side routing for React location / { try_files $uri /index.html; } # Proxy API requests to the 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; # Increase timeouts for large file uploads proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; proxy_request_buffering off; } # Cache static assets location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg)$ { expires 1y; add_header Cache-Control "public"; } }