Files
resty_functions/conf/huiwing/ts.conf
T

37 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-01-19 09:36:21 +08:00
server {
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
# server_name $servername;
2022-02-01 22:27:42 +08:00
server_name "ts.huiwings.cn";
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;
# disable in local test env
2022-02-01 22:27:42 +08:00
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
2022-01-19 09:36:21 +08:00
set $task_server "http://127.0.0.1:8080"; # task server host
set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $resty_loc "/usr/local/openresty";
location /api/v1/ts/ {
2022-01-19 21:25:53 +08:00
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'Authorization,HtyAdminToken,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Max-Age 86400;
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
}
}
# server {
# listen 80;
2022-02-01 22:27:42 +08:00
# server_name "ts.huiwings.cn";
2022-01-19 09:36:21 +08:00
# location / {
# return 301 https://$host$request_uri;
# }
# }