Spaces:
Sleeping
Sleeping
| worker_processes 1; | |
| daemon off; | |
| pid /tmp/nginx.pid; | |
| error_log /tmp/error.log; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| access_log /tmp/access.log; | |
| sendfile on; | |
| keepalive_timeout 65; | |
| client_max_body_size 100M; | |
| upstream main_backend { | |
| server 127.0.0.1:7862; | |
| } | |
| upstream preview_backend { | |
| server 127.0.0.1:7861; | |
| } | |
| server { | |
| listen 7860 default_server; | |
| server_name _; | |
| # Serve manifest.json directly | |
| location = /manifest.json { | |
| root /app; | |
| add_header Content-Type "application/manifest+json"; | |
| try_files $uri =404; | |
| } | |
| # Handle missing fallback font files gracefully | |
| location ~ ^/static/fonts/(ui-sans-serif|system-ui)/ { | |
| access_log off; | |
| return 204; | |
| } | |
| location /preview/ { | |
| rewrite /preview/(.*) /$1 break; | |
| proxy_pass http://preview_backend; | |
| proxy_buffering off; | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Forwarded-Host $http_host; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| } | |
| location / { | |
| proxy_pass http://main_backend; | |
| proxy_buffering off; | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Forwarded-Host $http_host; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| } | |
| } | |
| } | |