Spaces:
Sleeping
Sleeping
Download nginx.conf from feiver/cloudpaste: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/feiver/cloudpaste/resolve/main/nginx.conf
- Command line
-
hf download hf://spaces/feiver/cloudpaste/nginx.conf
-
curl -L -o nginx.conf https://huggingface.co/spaces/feiver/cloudpaste/resolve/main/nginx.conf
1.16 kB
| server { | |
| listen 3000 default_server; | |
| listen [::]:3000 default_server; | |
| server_name _; | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| # 安全相关的HTTP头 | |
| proxy_hide_header Access-Control-Allow-Origin; | |
| proxy_hide_header Access-Control-Allow-Headers; | |
| proxy_hide_header Access-Control-Allow-Methods; | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| add_header 'Access-Control-Allow-Headers' '*'; | |
| add_header 'Access-Control-Allow-Methods' '*'; | |
| # 特殊处理config.js,防止缓存 | |
| location = /config.js { | |
| add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; | |
| expires -1; | |
| } | |
| # 缓存静态资源 | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { | |
| expires max; | |
| add_header Cache-Control "public, max-age=31536000, immutable"; | |
| } | |
| # SPA路由处理 | |
| location / { | |
| try_files $uri $uri/ /index.html; | |
| } | |
| # 健康检查 | |
| location /health { | |
| return 200 'ok'; | |
| add_header Content-Type text/plain; | |
| } | |
| # 日志配置 | |
| access_log /var/log/nginx/access.log; | |
| error_log /var/log/nginx/error.log; | |
| } |