2023-04-09 16:27:14 +08:00
|
|
|
|
server {
|
|
|
|
|
|
server_name "proc.moicen.com";
|
|
|
|
|
|
listen 443 ssl;
|
|
|
|
|
|
listen 80;
|
|
|
|
|
|
client_max_body_size 10M;
|
|
|
|
|
|
|
|
|
|
|
|
# disable in local test env
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot
|
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem; # managed by Certbot
|
|
|
|
|
|
|
2026-03-29 11:37:16 +08:00
|
|
|
|
set $huiwing_htyproc_rust "127.0.0.1:3004"; # huiwing 仓库 htyproc(Rust)
|
|
|
|
|
|
|
2023-04-09 16:27:14 +08:00
|
|
|
|
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;
|
|
|
|
|
|
}
|
2026-04-26 22:16:49 +08:00
|
|
|
|
proxy_pass http://$huiwing_htyproc_rust/api/v1/proc/;
|
2023-04-09 16:27:14 +08:00
|
|
|
|
}
|
2026-03-29 11:37:16 +08:00
|
|
|
|
|
|
|
|
|
|
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/;
|
|
|
|
|
|
}
|
2023-04-09 16:27:14 +08:00
|
|
|
|
}
|