refactor: rename canto-backend → backend, canto-frontend → frontend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-07 18:11:00 +08:00
parent 2fa9c1fcb6
commit 60489eab59
327 changed files with 0 additions and 0 deletions

55
backend/deploy/nginx.conf Normal file
View File

@@ -0,0 +1,55 @@
upstream canto_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://canto_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/canto-backend/outputs/;
autoindex off;
add_header Cache-Control "public, max-age=3600";
add_header Content-Disposition "attachment";
}
location /health {
proxy_pass http://canto_backend/health;
proxy_set_header Host $host;
access_log off;
}
location /metrics {
proxy_pass http://canto_backend/metrics;
proxy_set_header Host $host;
allow 127.0.0.1;
deny all;
}
}

View File

@@ -0,0 +1,21 @@
[Unit]
Description=Canto Backend API Service
After=network.target
[Service]
Type=simple
User=qwen-tts
Group=qwen-tts
WorkingDirectory=/opt/canto-backend
Environment="PATH=/opt/conda/envs/canto/bin:/usr/local/bin:/usr/bin:/bin"
EnvironmentFile=/opt/canto-backend/.env
ExecStart=/opt/conda/envs/canto/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