Spaces:
Paused
Paused
Download deploy/nginx.conf from whassan/SensorflowStudio: direct link, hf CLI and curl.
- Browser
- Download file 1.96 kB
-
https://huggingface.co/spaces/whassan/SensorflowStudio/resolve/main/deploy/nginx.conf
- Command line
-
hf download hf://spaces/whassan/SensorflowStudio/deploy/nginx.conf
-
curl -L -o nginx.conf https://huggingface.co/spaces/whassan/SensorflowStudio/resolve/main/deploy/nginx.conf
1.96 kB
| upstream studio_backend { | |
| server 127.0.0.1:8001; | |
| } | |
| upstream analysis_backend { | |
| server 127.0.0.1:8002; | |
| } | |
| server { | |
| listen 80; | |
| server_name sensorflow.wael.bot; | |
| client_max_body_size 100M; | |
| # Redirect HTTP to HTTPS (when cert is ready) | |
| # return 301 https://$server_name$request_uri; | |
| # Sensorflow Studio API | |
| location /api/studio/ { | |
| proxy_pass http://studio_backend/; | |
| 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; | |
| proxy_read_timeout 300s; | |
| proxy_connect_timeout 300s; | |
| } | |
| # Accident Analysis API | |
| location /api/analysis/ { | |
| proxy_pass http://analysis_backend/; | |
| 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; | |
| proxy_read_timeout 300s; | |
| proxy_connect_timeout 300s; | |
| } | |
| # WebSocket support for Accident Analysis | |
| location /ws/ { | |
| proxy_pass http://analysis_backend/ws/; | |
| 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; | |
| } | |
| # React Frontend | |
| location / { | |
| root /opt/sensorflow/studio/dist; | |
| try_files $uri $uri/ /index.html; | |
| expires 1h; | |
| add_header Cache-Control "public, max-age=3600"; | |
| } | |
| # Health checks | |
| location /health/studio { | |
| proxy_pass http://studio_backend/docs; | |
| access_log off; | |
| } | |
| location /health/analysis { | |
| proxy_pass http://analysis_backend/docs; | |
| access_log off; | |
| } | |
| } | |