Files
resty_functions/conf/moicen/admin.conf
T

94 lines
3.1 KiB
Plaintext
Raw Normal View History

2021-09-04 12:38:15 +08:00
server {
2022-03-04 23:11:04 +08:00
proxy_read_timeout 30;
proxy_connect_timeout 30;
proxy_send_timeout 30;
2021-11-28 09:59:30 +08:00
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
# server_name $servername;
2022-01-15 21:23:13 +08:00
server_name "admin.moicen.com";
2021-09-04 12:38:15 +08:00
listen 443 ssl;
2022-04-29 20:36:57 +08:00
client_max_body_size 20M;
2021-09-04 12:38:15 +08:00
2021-11-18 20:45:55 +08:00
# disable in local test env
2022-01-21 02:51:53 +08:00
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
2021-11-18 20:45:55 +08:00
2022-03-09 02:16:35 +08:00
set $tmp_file_dir "/file_upload"; # 文件存储路径
2021-11-28 16:29:59 +08:00
set $task_server "http://127.0.0.1:8080"; # task server host
set $htyuc "http://127.0.0.1:3000"; #htyuc host
2021-11-18 20:45:55 +08:00
set $resty_loc "/usr/local/openresty";
2021-11-28 09:30:52 +08:00
set $convert "/usr/bin/convert";
2022-01-28 02:48:31 +08:00
set $upyun_operator "moicen";
set $upyun_password "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN";
2022-02-02 00:07:56 +08:00
set $upyun_bucket "moicen";
2022-01-28 02:48:31 +08:00
set $upyun_directory "music-room";
2022-02-02 00:07:56 +08:00
set $upyun_cdn "https://upyun.moicen.com/";
2022-06-11 22:59:03 +08:00
set $wx_domain "wx.moicen.com";
2021-09-04 12:38:15 +08:00
location / {
try_files $uri $uri/ /index.html;
2022-01-15 21:23:13 +08:00
proxy_set_header Host "admin.moicen.com";
2021-09-04 12:38:15 +08:00
proxy_set_header X-Real-IP $remote_addr;
2021-11-18 20:45:55 +08:00
# disable in local test env
2021-09-04 12:38:15 +08:00
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
}
2022-01-15 21:23:13 +08:00
root $resty_loc/nginx/html/admin;
2021-09-04 12:38:15 +08:00
index index.html;
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,unionid,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-20 20:48:00 +08:00
if ($request_method = 'OPTIONS') {
return 200;
}
2021-09-04 12:38:15 +08:00
#Upload image files
location /api/ngx/image/upload {
2022-01-21 03:34:33 +08:00
content_by_lua_file $resty_loc/nginx/scripts/upload.lua;
2021-09-04 12:38:15 +08:00
}
#Combine image files
location /api/ngx/image/combine {
2022-01-21 03:34:33 +08:00
content_by_lua_file $resty_loc/nginx/scripts/combine.lua;
2021-09-04 12:38:15 +08:00
}
2022-03-09 02:11:58 +08:00
location /api/ngx/image/check {
content_by_lua_file $resty_loc/nginx/scripts/check_file.lua;
}
location /api/ngx/image/upload_combined {
content_by_lua_file $resty_loc/nginx/scripts/upload_combined_image.lua;
}
2021-12-30 22:04:57 +08:00
#Audio file download
2021-12-30 22:22:15 +08:00
location /api/ngx/audio/upload {
2022-01-21 03:34:33 +08:00
content_by_lua_file $resty_loc/nginx/scripts/upload_audio.lua;
2021-12-30 22:04:57 +08:00
}
#Audio file convert
location /api/ngx/audio/convert {
2022-01-21 03:34:33 +08:00
content_by_lua_file $resty_loc/nginx/scripts/convert_audio.lua;
}
2021-09-04 12:38:15 +08:00
2022-01-28 02:25:18 +08:00
location /api/ngx/convert/test {
content_by_lua_file $resty_loc/nginx/scripts/test.lua;
}
2021-09-04 12:38:15 +08:00
location /api/v1/ws/ {
proxy_pass http://127.0.0.1:3001/api/v1/ws/;
}
location /api/v1/uc/ {
proxy_pass http://127.0.0.1:3000/api/v1/uc/;
}
}
2021-11-28 10:09:52 +08:00
server {
listen 80;
2022-01-15 21:23:13 +08:00
server_name "admin.moicen.com";
2021-11-28 10:09:52 +08:00
location / {
return 301 https://$host$request_uri;
}
}