|
|
@@ -1,48 +1,41 @@
|
|
|
-server {
|
|
|
- listen 80;
|
|
|
- server_name _;
|
|
|
-
|
|
|
- # Frontend - serve static files
|
|
|
- location / {
|
|
|
- root /app/static/dist;
|
|
|
- index index.html;
|
|
|
- try_files $uri $uri/ /index.html;
|
|
|
- }
|
|
|
-
|
|
|
- # Serve static assets (legacy CSS, images, etc.)
|
|
|
- location /static/ {
|
|
|
- alias /app/static/;
|
|
|
- expires 1d;
|
|
|
- add_header Cache-Control "public, immutable";
|
|
|
- }
|
|
|
-
|
|
|
- # API proxy to backend
|
|
|
- location /api/ {
|
|
|
- proxy_pass http://127.0.0.1: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://127.0.0.1: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;
|
|
|
- }
|
|
|
-
|
|
|
- # Legacy endpoints (non-/api/ routes that go to backend)
|
|
|
- location ~ ^/(preview_thr_batch|get_theta_rho_coordinates|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand) {
|
|
|
- proxy_pass http://127.0.0.1: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;
|
|
|
- }
|
|
|
-}
|
|
|
+server {
|
|
|
+ listen 80;
|
|
|
+ server_name _;
|
|
|
+
|
|
|
+ # 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ # Legacy endpoints (non-/api/ routes that go to backend)
|
|
|
+ location ~ ^/(preview_thr_batch|get_theta_rho_coordinates|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+}
|