Spaces:
Running
Running
| #this gets copied into the nginx settings during space creation... see dockerfile | |
| server { | |
| listen 7860; | |
| server_name localhost; | |
| # Specific to HF Spaces: Allow larger headers for their proxy setup | |
| large_client_header_buffers 4 32k; | |
| proxy_connect_timeout 600; | |
| proxy_send_timeout 600; | |
| proxy_read_timeout 600; | |
| send_timeout 600; | |
| # Additional headers specific to running behind HF Spaces proxy | |
| 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_set_header X-Forwarded-Host $host; | |
| client_max_body_size 50M; | |
| # the node.js api runs on localhost:6666 | |
| # here we tell nginx that requests to /API should forward there | |
| location /api/ { | |
| #rewrite ^/API/images/(.*) /$1 break; | |
| proxy_pass http://localhost:6666; | |
| proxy_buffering on; | |
| proxy_buffer_size 128k; | |
| proxy_buffers 4 256k; | |
| proxy_busy_buffers_size 256k; | |
| } | |
| #location /API/tts/ { | |
| # rewrite ^/API/tts/(.*) /$1 break; | |
| # proxy_pass http://localhost:5555; | |
| # proxy_http_version 1.1; | |
| # proxy_set_header Upgrade $http_upgrade; | |
| # proxy_set_header Connection "upgrade"; | |
| #} | |
| # Required for HF Spaces health checks | |
| location / { | |
| proxy_pass http://localhost:6666; | |
| proxy_buffering on; | |
| proxy_buffer_size 128k; | |
| proxy_buffers 4 256k; | |
| proxy_busy_buffers_size 256k; | |
| } | |
| } |