Files
VoxCPM/docker/nginx.conf
Daniel Cox 4af38a9ddc fix: replace FORWARDED_ALLOW_IPS with nginx map, add .dockerignore
HTTPS proxy handling moved entirely to nginx (map $http_x_forwarded_proto).

- .dockerignore to exclude models/data/lora/output from build context
- nginx: manifest.json returns proper JSON for PWA, favicon returns 204
- docker-compose: drop version key, remove FORWARDED_ALLOW_IPS env var
- README: update HTTPS troubleshooting (nginx map handles it now)
2026-08-12 11:57:37 +09:30

49 lines
1.4 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 = / {
return 200 'OK\n';
add_header Content-Type text/plain;
}
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;
}
}