init commit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-26 15:34:31 +08:00
commit 80513a3258
141 changed files with 24966 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
upstream qwen_tts_backend {
server 127.0.0.1:8000;
}
server {
listen 80;
server_name your-domain.com;
client_max_body_size 100M;
client_body_timeout 300s;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
location / {
proxy_pass http://qwen_tts_backend;
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;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type';
add_header 'Content-Length' '0';
add_header 'Content-Type' 'text/plain';
return 204;
}
}
location /outputs/ {
alias /opt/qwen3-tts-backend/outputs/;
autoindex off;
add_header Cache-Control "public, max-age=3600";
add_header Content-Disposition "attachment";
}
location /health {
proxy_pass http://qwen_tts_backend/health;
proxy_set_header Host $host;
access_log off;
}
location /metrics {
proxy_pass http://qwen_tts_backend/metrics;
proxy_set_header Host $host;
allow 127.0.0.1;
deny all;
}
}

View File

@@ -0,0 +1,21 @@
[Unit]
Description=Qwen3-TTS Backend API Service
After=network.target
[Service]
Type=simple
User=qwen-tts
Group=qwen-tts
WorkingDirectory=/opt/qwen3-tts-backend
Environment="PATH=/opt/conda/envs/qwen3-tts/bin:/usr/local/bin:/usr/bin:/bin"
EnvironmentFile=/opt/qwen3-tts-backend/.env
ExecStart=/opt/conda/envs/qwen3-tts/bin/python main.py
Restart=on-failure
RestartSec=10s
StandardOutput=append:/var/log/qwen-tts/app.log
StandardError=append:/var/log/qwen-tts/error.log
TimeoutStopSec=30s
KillMode=mixed
[Install]
WantedBy=multi-user.target