feat: /api/v2 ts/proc to Rust htyts:3003 htyproc:3004, admin routes

- ts.conf/proc.conf: v2 locations and huiwing_htyts_rust/htyproc_rust vars
- admin.conf: /api/v2/ts and /api/v2/proc on admin for same-origin tests
- local_macos proc.conf; remove duplicate conf/alchemy
- huiwings ai.conf: coze auth comment lines merged from removed alchemy copy

Made-with: Cursor
This commit is contained in:
2026-03-29 11:37:16 +08:00
parent e136e957ba
commit 0d7dd28f28
14 changed files with 199 additions and 78 deletions
+16
View File
@@ -8,6 +8,9 @@ server {
ssl_certificate /etc/letsencrypt/live/huiwings.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/huiwings.cn/privkey.pem; # managed by Certbot
# huiwing 仓库:`cargo run -p htyproc`env 见 envs/*/htyproc.envPROC_PORT=3004
set $huiwing_htyproc_rust "127.0.0.1:3004";
location /api/v1/proc/ {
add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
@@ -19,4 +22,17 @@ server {
}
proxy_pass http://127.0.0.1:8880/api/v1/proc/;
}
# Rust htyproc:对外 /api/v2/proc → 本进程;后端路由仍为 /api/v1/proc
location /api/v2/proc/ {
add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
add_header Access-Control-Allow-Headers 'Authorization,HtyAdminToken,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
add_header Access-Control-Allow-Credentials true always;
add_header Access-Control-Max-Age 86400 always;
if ($request_method = 'OPTIONS') {
return 200;
}
proxy_pass http://$huiwing_htyproc_rust/api/v1/proc/;
}
}