mirror of
https://github.com/OpenBMB/VoxCPM.git
synced 2026-09-20 10:53:32 +08:00
52 lines
1.5 KiB
Nginx Configuration File
52 lines
1.5 KiB
Nginx Configuration File
# Preserve X-Forwarded-Proto from upstream load balancer (e.g. AWS ALB).
|
|
# If ALB already set it to "https", pass that through instead of $scheme
|
|
# (which is "http" since ALB→nginx is unencrypted). Falls back to $scheme
|
|
# when accessed directly (no upstream proxy).
|
|
map $http_x_forwarded_proto $forwarded_proto {
|
|
default $http_x_forwarded_proto;
|
|
"" $scheme;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
absolute_redirect off;
|
|
|
|
# Health check for load balancers (AWS ALB, etc.)
|
|
location = / {
|
|
proxy_pass http://training-webui:7860/;
|
|
proxy_set_header Host $host;
|
|
proxy_read_timeout 5s;
|
|
proxy_connect_timeout 3s;
|
|
access_log off;
|
|
}
|
|
|
|
location = /manifest.json {
|
|
return 200 '{"name":"VoxCPM Training","short_name":"VoxCPM","start_url":"/webui/"}';
|
|
default_type application/json;
|
|
}
|
|
|
|
location = /favicon.ico {
|
|
return 204;
|
|
access_log off;
|
|
}
|
|
|
|
location /webui/ {
|
|
proxy_pass http://training-webui:7860/;
|
|
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 $forwarded_proto;
|
|
|
|
# WebSocket support (required for Gradio)
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
# Increase timeouts for long-running training operations
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
}
|
|
}
|