2022-01-19 09:36:21 +08:00
|
|
|
server {
|
|
|
|
|
server_name "ts.moicen.com";
|
2022-01-19 19:17:03 +08:00
|
|
|
listen 443 ssl;
|
2022-01-19 09:36:21 +08:00
|
|
|
listen 80;
|
|
|
|
|
client_max_body_size 10M;
|
|
|
|
|
|
2026-04-26 20:48:49 +08:00
|
|
|
ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem;
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem;
|
2022-01-19 09:36:21 +08:00
|
|
|
|
2026-04-26 20:48:49 +08:00
|
|
|
set $task_server "http://127.0.0.1:8080";
|
|
|
|
|
set $huiwing_htyts_rust "127.0.0.1:3003";
|
2026-03-29 11:37:16 +08:00
|
|
|
set $task_server_rust "http://$huiwing_htyts_rust";
|
2026-04-26 20:48:49 +08:00
|
|
|
set $htyuc "http://127.0.0.1:3000";
|
2022-01-19 09:36:21 +08:00
|
|
|
set $resty_loc "/usr/local/openresty";
|
|
|
|
|
|
|
|
|
|
location /api/v1/ts/ {
|
2022-02-12 23:49:56 +08:00
|
|
|
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;
|
2022-01-19 21:25:53 +08:00
|
|
|
if ($request_method = 'OPTIONS') {
|
|
|
|
|
return 200;
|
2022-01-19 19:17:03 +08:00
|
|
|
}
|
2022-01-19 21:25:53 +08:00
|
|
|
proxy_pass http://127.0.0.1:8080/api/v1/ts/;
|
2022-01-19 09:36:21 +08:00
|
|
|
}
|
2026-03-29 11:37:16 +08:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
2026-04-26 20:48:49 +08:00
|
|
|
rewrite ^/api/v2/ts/$ /api/v1/ts break;
|
|
|
|
|
rewrite ^/api/v2/ts/(.+)$ /api/v1/ts/$1 break;
|
|
|
|
|
proxy_pass http://127.0.0.1:3003;
|
2026-03-29 11:37:16 +08:00
|
|
|
}
|
2022-01-19 09:36:21 +08:00
|
|
|
}
|