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-02-01 22:27:42 +08:00
|
|
|
server_name "music-room.alchemy-studio.cn";
|
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
|
|
|
|
2022-01-28 21:24:53 +08:00
|
|
|
set $resty_loc "/usr/local/openresty";
|
|
|
|
|
|
2021-11-18 20:45:55 +08:00
|
|
|
# disable in local test env
|
2022-02-01 22:27:42 +08:00
|
|
|
ssl_certificate /etc/letsencrypt/live/alchemy-studio.cn/fullchain.pem; # managed by Certbot
|
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/alchemy-studio.cn/privkey.pem; # managed by Certbot
|
2021-11-18 20:45:55 +08:00
|
|
|
|
2021-09-04 12:38:15 +08:00
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
2022-02-01 22:27:42 +08:00
|
|
|
proxy_set_header Host "music-room.alchemy-studio.cn";
|
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-02-01 22:27:42 +08:00
|
|
|
root $resty_loc/nginx/html/alchemy/music-room;
|
2021-09-04 12:38:15 +08:00
|
|
|
index index.html;
|
|
|
|
|
|
2022-02-01 23:23:34 +08:00
|
|
|
# 公众号校验 炼金工坊
|
2022-01-15 21:23:13 +08:00
|
|
|
location /MP_verify_Jo6pKmy43wx7S5Sh.txt {
|
|
|
|
|
return 200 'Jo6pKmy43wx7S5Sh';
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-01 23:23:34 +08:00
|
|
|
# 公众号校验 慧添翼音乐教室
|
|
|
|
|
location /MP_verify_xDbyXEtPHigY8dCN.txt {
|
|
|
|
|
return 200 'xDbyXEtPHigY8dCN';
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 21:23:13 +08:00
|
|
|
# 小程序业务域名校验
|
|
|
|
|
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-02-01 22:27:42 +08:00
|
|
|
server_name "music-room.alchemy-studio.cn";
|
2021-11-28 10:09:52 +08:00
|
|
|
location / {
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
}
|
|
|
|
|
}
|