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
committed by Wei Nan Li
parent e136e957ba
commit 3fbe5e900a
14 changed files with 199 additions and 78 deletions
+18 -1
View File
@@ -6,7 +6,9 @@ server {
client_max_body_size 10M;
set $tmp_file_dir "/usr/local/file_upload"; # 文件存储路径
set $task_server "http://127.0.0.1:8080"; # task server host
set $task_server "http://127.0.0.1:8080"; # Java task_server
set $huiwing_htyts_rust "127.0.0.1:3003";
set $huiwing_htyproc_rust "127.0.0.1:3004";
# set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $htyuc "https://admin.moicen.com"; #Verify jwt token
set $resty_loc "/usr/local/opt/openresty";
@@ -105,6 +107,21 @@ server {
proxy_pass http://127.0.0.1:3000/api/v1/uc/;
}
location /api/v2/ts/ {
proxy_pass http://$huiwing_htyts_rust/api/v1/ts/;
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;
}
location /api/v2/proc/ {
proxy_pass http://$huiwing_htyproc_rust/api/v1/proc/;
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;
}
location /api/ngx/upyun_download {
content_by_lua_file $resty_loc/nginx/scripts/upyun_download.lua;
}
+31
View File
@@ -0,0 +1,31 @@
server {
server_name "proc.localhost";
listen 8088;
client_max_body_size 10M;
set $huiwing_htyproc_rust "127.0.0.1:3004"; # huiwing 仓库 htyprocRust
location /api/v1/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://127.0.0.1:8880/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/;
}
}
+15 -1
View File
@@ -5,7 +5,9 @@ server {
listen 8088;
client_max_body_size 10M;
set $task_server "http://127.0.0.1:8080"; # task server host
set $task_server "http://127.0.0.1:8080"; # Java task_server
set $huiwing_htyts_rust "127.0.0.1:3003"; # huiwing 仓库 htytsRust
set $task_server_rust "http://$huiwing_htyts_rust";
set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $resty_loc "/usr/local/opt/openresty";
@@ -20,5 +22,17 @@ server {
}
proxy_pass http://127.0.0.1:8080/api/v1/ts/;
}
location /api/v2/ts/ {
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_htyts_rust/api/v1/ts/;
}
}