| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- server {
- listen 80;
- server_name _;
- # Increase max upload size for pattern files
- client_max_body_size 10M;
- # Frontend - serve static files
- location / {
- root /usr/share/nginx/html;
- index index.html;
- try_files $uri $uri/ /index.html;
- }
- # API proxy to backend container
- location /api/ {
- proxy_pass http://backend:8080;
- 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;
- }
- # WebSocket proxy
- location /ws/ {
- proxy_pass http://backend:8080;
- 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_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_read_timeout 86400;
- }
- # Static files from backend (pattern previews, custom logos)
- location /static/ {
- proxy_pass http://backend:8080;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_cache_valid 200 1h;
- }
- # All backend API endpoints (legacy non-/api/ routes)
- location ~ ^/(list_theta_rho_files|preview_thr_batch|get_theta_rho_coordinates|upload_theta_rho|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand|move_to_position|get_playlists|save_playlist|delete_playlist|rename_playlist|get_status) {
- proxy_pass http://backend:8080;
- 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;
- }
- }
|