2021-09-04 12:38:15 +08:00
|
|
|
server {
|
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 "music-room.moicen.com";
|
2021-09-04 12:38:15 +08:00
|
|
|
listen 443 ssl;
|
2021-12-30 23:11:12 +08:00
|
|
|
client_max_body_size 10M;
|
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
|
|
|
|
|
|
|
|
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";
|
2021-09-04 12:38:15 +08:00
|
|
|
|
2022-01-14 14:11:17 +08:00
|
|
|
set $upyun_operator "moicen";
|
2022-01-15 21:25:31 +08:00
|
|
|
set $upyun_password "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN";
|
2022-01-14 14:11:17 +08:00
|
|
|
set $upyun_bucket "huiwing";
|
2022-01-15 21:25:31 +08:00
|
|
|
set $upyun_directory "music-room";
|
|
|
|
|
set $upyun_cdn "https://upyun.alchemy-studio.cn/music-room/";
|
2022-01-14 14:11:17 +08:00
|
|
|
set $upyun_api "https://v2.api.upyun.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 "music-room.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;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-18 20:45:55 +08:00
|
|
|
root $resty_loc/nginx/html/music-room;
|
2021-09-04 12:38:15 +08:00
|
|
|
index index.html;
|
|
|
|
|
|
2022-01-15 21:23:13 +08:00
|
|
|
# 公众号校验
|
|
|
|
|
location /MP_verify_Jo6pKmy43wx7S5Sh.txt {
|
|
|
|
|
return 200 'Jo6pKmy43wx7S5Sh';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 小程序业务域名校验
|
|
|
|
|
location /Q25f8xC3Jo.txt {
|
|
|
|
|
return 200 '323072b225a694281cd23496fa6737ef';
|
2021-12-31 12:17:53 +08:00
|
|
|
}
|
2021-09-04 12:38:15 +08:00
|
|
|
}
|
2021-11-28 10:09:52 +08:00
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
2022-01-15 21:23:13 +08:00
|
|
|
server_name "music-room.moicen.com";
|
2021-11-28 10:09:52 +08:00
|
|
|
location / {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
}
|
|
|
|
|
}
|