Spaces:
Sleeping
Sleeping
Download nginx.conf from orakzai-io/Rednote: direct link, hf CLI and curl.
- Browser
- Download file 2.69 kB
-
https://huggingface.co/spaces/orakzai-io/Rednote/resolve/main/nginx.conf
- Command line
-
hf download hf://spaces/orakzai-io/Rednote/nginx.conf
-
curl -L -o nginx.conf https://huggingface.co/spaces/orakzai-io/Rednote/resolve/main/nginx.conf
2.69 kB
| # ββ Production HTTPS Setup ββββββββββββββββββββββββββββββββββββββββ | |
| # To enable HTTPS, run certbot or use a reverse proxy like Caddy. | |
| # Example with certbot: | |
| # server { | |
| # listen 443 ssl http2; | |
| # server_name yourdomain.com; | |
| # ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; | |
| # ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; | |
| # # ... copy the rest of this config below ... | |
| # } | |
| # server { | |
| # listen 80; | |
| # server_name yourdomain.com; | |
| # return 301 https://$server_name$request_uri; | |
| # } | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| server { | |
| listen 80; | |
| server_name _; | |
| # Root directory for the built frontend | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| # Gzip compression for better performance | |
| gzip on; | |
| gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml; | |
| gzip_min_length 256; | |
| # Increase max body size for document uploads (matching backend MAX_FILE_SIZE: 10MB) | |
| client_max_body_size 10M; | |
| # ββ API proxy βββββββββββββββββββββββββββββββββββββββββββββ | |
| # All /api/* requests are forwarded to the FastAPI backend. | |
| # The frontend code in production should use /api/... as the | |
| # base path (e.g., fetch('/api/chat', ...)). | |
| location /api/ { | |
| proxy_pass http://backend:8000/; | |
| 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_set_header X-Forwarded-Proto $scheme; | |
| # Timeouts for long-running streaming chat requests | |
| proxy_read_timeout 120s; | |
| proxy_send_timeout 120s; | |
| # Disable buffering needed for streaming responses | |
| proxy_buffering off; | |
| } | |
| # ββ SPA fallback ββββββββββββββββββββββββββββββββββββββββββ | |
| # For any non-file, non-API route, serve index.html so React | |
| # Router can handle client-side routing. | |
| location / { | |
| try_files $uri $uri/ /index.html; | |
| } | |
| } |