Spaces:
Sleeping
Sleeping
upload
Browse files- nginx.spaces.conf +75 -0
nginx.spaces.conf
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
user root;
|
| 2 |
+
worker_processes auto;
|
| 3 |
+
pid /tmp/nginx.pid;
|
| 4 |
+
error_log /tmp/nginx_error.log warn;
|
| 5 |
+
|
| 6 |
+
events {
|
| 7 |
+
worker_connections 1024;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
http {
|
| 11 |
+
include /etc/nginx/mime.types;
|
| 12 |
+
default_type application/octet-stream;
|
| 13 |
+
|
| 14 |
+
access_log /tmp/nginx_access.log;
|
| 15 |
+
|
| 16 |
+
client_body_temp_path /tmp/client_body;
|
| 17 |
+
proxy_temp_path /tmp/proxy_temp;
|
| 18 |
+
fastcgi_temp_path /tmp/fastcgi_temp;
|
| 19 |
+
uwsgi_temp_path /tmp/uwsgi_temp;
|
| 20 |
+
scgi_temp_path /tmp/scgi_temp;
|
| 21 |
+
|
| 22 |
+
sendfile on;
|
| 23 |
+
keepalive_timeout 65;
|
| 24 |
+
client_max_body_size 100M;
|
| 25 |
+
|
| 26 |
+
# Main server on port 7860 (Hugging Face expects this)
|
| 27 |
+
server {
|
| 28 |
+
listen 7860;
|
| 29 |
+
server_name _;
|
| 30 |
+
|
| 31 |
+
# Frontend (Next.js)
|
| 32 |
+
location / {
|
| 33 |
+
proxy_pass http://localhost:3001;
|
| 34 |
+
proxy_http_version 1.1;
|
| 35 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 36 |
+
proxy_set_header Connection 'upgrade';
|
| 37 |
+
proxy_set_header Host $host;
|
| 38 |
+
proxy_cache_bypass $http_upgrade;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
# Backend WebSocket
|
| 42 |
+
location /ws {
|
| 43 |
+
proxy_pass http://localhost:8000;
|
| 44 |
+
proxy_http_version 1.1;
|
| 45 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 46 |
+
proxy_set_header Connection "upgrade";
|
| 47 |
+
proxy_set_header Host $host;
|
| 48 |
+
proxy_read_timeout 86400;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
# Backend API
|
| 52 |
+
location /api {
|
| 53 |
+
proxy_pass http://localhost:8000;
|
| 54 |
+
proxy_set_header Host $host;
|
| 55 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
# Avatar TTS
|
| 59 |
+
location /speak {
|
| 60 |
+
proxy_pass http://localhost:8765;
|
| 61 |
+
proxy_set_header Host $host;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
location /static {
|
| 65 |
+
proxy_pass http://localhost:8765;
|
| 66 |
+
proxy_set_header Host $host;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
# Health check
|
| 70 |
+
location /health {
|
| 71 |
+
proxy_pass http://localhost:8000/health;
|
| 72 |
+
proxy_set_header Host $host;
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
}
|