add conf for subdomain teacher
This commit is contained in:
@@ -1,113 +0,0 @@
|
||||
server {
|
||||
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
|
||||
# server_name $servername;
|
||||
server_name "admin.alchemy-studio.cn";
|
||||
listen 443 ssl;
|
||||
client_max_body_size 10M;
|
||||
|
||||
# disable in local test env
|
||||
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
|
||||
|
||||
set $tmp_file_dir "/file_upload"; # 文件存储路径
|
||||
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";
|
||||
set $convert "/usr/bin/convert";
|
||||
set $upyun_operator "moicen";
|
||||
set $upyun_password "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN";
|
||||
set $upyun_bucket "alchemy";
|
||||
set $upyun_directory "music-room";
|
||||
set $upyun_domain "https://upyun.alchemy-studio.cn";
|
||||
set $wx_domain "wx.alchemy-studio.cn";
|
||||
set $upt_huiwings_secret "C5E4B01EC86A4CE8A84871EA2C826DD1";
|
||||
set $upt_moicen_secret "339666FBB93C46D7B00D9F6E790C6C18";
|
||||
set $upt_alchemy_secret "0D32E581A445404FA4C306709724FA07";
|
||||
set $upt_duration 3600;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
proxy_set_header Host "admin.alchemy-studio.cn";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# disable in local test env
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
root $resty_loc/nginx/html/admin;
|
||||
index index.html;
|
||||
|
||||
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;
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
#Upload image files
|
||||
location /api/ngx/image/upload {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/old_upload.lua;
|
||||
}
|
||||
#upload image from weixin media
|
||||
location /api/ngx/image/wx_upload_single {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/wx_upload_single.lua;
|
||||
}
|
||||
#upload image files to combine by form
|
||||
location /api/ngx/image/form_upload_to_combine {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/form_upload_to_combine.lua;
|
||||
}
|
||||
#Upload image files to combine by wx
|
||||
location /api/ngx/image/wx_upload_to_combine {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/wx_upload_to_combine.lua;
|
||||
}
|
||||
#compress image file by form
|
||||
location /api/ngx/image/form_upload_to_compress {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/form_upload_to_compress.lua;
|
||||
}
|
||||
#Combine image files
|
||||
location /api/ngx/image/combine {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/combine.lua;
|
||||
}
|
||||
#Audio file download
|
||||
location /api/ngx/audio/upload {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/upload_audio.lua;
|
||||
}
|
||||
#Audio file convert
|
||||
location /api/ngx/audio/convert {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/convert_audio.lua;
|
||||
}
|
||||
|
||||
location /api/ngx/upt {
|
||||
content_by_lua_file $resty_loc/nginx/scripts/upt.lua;
|
||||
}
|
||||
|
||||
# location /api/ngx/convert/test {
|
||||
# content_by_lua_file $resty_loc/nginx/scripts/test.lua;
|
||||
# }
|
||||
|
||||
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/;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name "admin.alchemy-studio.cn";
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
server {
|
||||
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
|
||||
# server_name $servername;
|
||||
server_name "music-room.alchemy-studio.cn";
|
||||
listen 443 ssl;
|
||||
client_max_body_size 10M;
|
||||
|
||||
set $resty_loc "/usr/local/openresty";
|
||||
|
||||
# disable in local test env
|
||||
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
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
proxy_set_header Host "music-room.alchemy-studio.cn";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# disable in local test env
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
root $resty_loc/nginx/html/music-room;
|
||||
index index.html;
|
||||
|
||||
# 公众号校验 炼金工坊
|
||||
location /MP_verify_Jo6pKmy43wx7S5Sh.txt {
|
||||
return 200 'Jo6pKmy43wx7S5Sh';
|
||||
}
|
||||
|
||||
# 公众号校验 慧添翼音乐教室
|
||||
location /MP_verify_xDbyXEtPHigY8dCN.txt {
|
||||
return 200 'xDbyXEtPHigY8dCN';
|
||||
}
|
||||
|
||||
# 小程序业务域名校验
|
||||
location /wy7of6ofMw.txt {
|
||||
return 200 'aa91a8d33359e82465dcc0aae9284b27';
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name "music-room.alchemy-studio.cn";
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
server {
|
||||
server_name "proc.alchemy-studio.cn";
|
||||
listen 443 ssl;
|
||||
listen 80;
|
||||
client_max_body_size 10M;
|
||||
|
||||
# disable in local test env
|
||||
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
|
||||
|
||||
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;
|
||||
}
|
||||
proxy_pass http://127.0.0.1:8880/api/v1/proc/;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
server {
|
||||
server_name "ts.alchemy-studio.cn";
|
||||
listen 443 ssl;
|
||||
listen 80;
|
||||
client_max_body_size 10M;
|
||||
|
||||
# disable in local test env
|
||||
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
|
||||
|
||||
location /api/v1/ts/ {
|
||||
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://127.0.0.1:8080/api/v1/ts/;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
server {
|
||||
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
|
||||
# server_name $servername;
|
||||
server_name "teacher.huiwings.cn";
|
||||
listen 443 ssl;
|
||||
client_max_body_size 10M;
|
||||
|
||||
set $resty_loc "/usr/local/openresty";
|
||||
|
||||
# disable in local test env
|
||||
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
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
proxy_set_header Host "teacher.huiwings.cn";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# disable in local test env
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
root $resty_loc/nginx/html/teacher;
|
||||
index index.html;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name "teacher.huiwings.cn";
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
server {
|
||||
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
|
||||
# server_name $servername;
|
||||
server_name "teacher.moicen.com";
|
||||
listen 443 ssl;
|
||||
client_max_body_size 20M;
|
||||
|
||||
set $resty_loc "/usr/local/openresty";
|
||||
|
||||
# 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
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
proxy_set_header Host "teacher.moicen.com";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# disable in local test env
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
root $resty_loc/nginx/html/teacher;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name "teacher.moicen.com";
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ function _M.upt(url)
|
||||
if string.find(hostname, "moicen.com") then
|
||||
ngx.log(ngx.INFO, 'match moicen.com: ' .. ngx.var.upt_moicen_secret)
|
||||
secret = ngx.var.upt_moicen_secret
|
||||
elseif string.find(hostname, "alchemy") then
|
||||
elseif string.find(hostname, "alchemy-studio.cn", true) then
|
||||
ngx.log(ngx.INFO, 'match alchemy: ' .. ngx.var.upt_alchemy_secret)
|
||||
secret = ngx.var.upt_alchemy_secret
|
||||
elseif string.find(hostname, "huiwings.cn") then
|
||||
|
||||
Reference in New Issue
Block a user