Spaces:
Sleeping
Sleeping
Download frontend/nginx.conf from dauphinking/pump: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/dauphinking/pump/resolve/main/frontend/nginx.conf
- Command line
-
hf download hf://spaces/dauphinking/pump/frontend/nginx.conf
-
curl -L -o nginx.conf https://huggingface.co/spaces/dauphinking/pump/resolve/main/frontend/nginx.conf
1.3 kB
| server { | |
| listen 80; | |
| server_name _; | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| # Node-RED 最新实时快照;必须放在通用 /api 代理之前 | |
| location = /api/realtime { | |
| proxy_pass http://nodered:1880/api/realtime; | |
| proxy_set_header Host $host; | |
| add_header Cache-Control "no-store"; | |
| } | |
| # 优化后端 API(同源 /api → backend 容器) | |
| location /api/ { | |
| proxy_pass http://backend:8077; | |
| proxy_set_header Host $host; | |
| } | |
| # Node-RED 实时数据 WebSocket(同源 /ws → nodered 容器) | |
| location /ws/ { | |
| proxy_pass http://nodered:1880; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_set_header Host $host; | |
| } | |
| # 展示页不缓存(改动即时生效);js 长缓存 | |
| location = /index.html { add_header Cache-Control "no-store"; } | |
| location = /config.html { add_header Cache-Control "no-store"; } | |
| location = /home.html { add_header Cache-Control "no-store"; } | |
| location = / { try_files /home.html =404; add_header Cache-Control "no-store"; } | |
| location ~* \.js$ { add_header Cache-Control "public, max-age=86400"; } | |
| location / { try_files $uri $uri/ /index.html; } | |
| } | |