generate upyun token for access
This commit is contained in:
@@ -20,6 +20,8 @@ server {
|
||||
set $upyun_directory "music-room";
|
||||
set $upyun_cdn "https://upyun.alchemy-studio.cn/";
|
||||
set $wx_domain "wx.alchemy-studio.cn";
|
||||
set $upt_secret "C29DBA1F1EA4462088136C3A85C2FBFC";
|
||||
set $upt_duration 3600;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
@@ -80,6 +82,10 @@ server {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ server {
|
||||
set $upyun_directory "music-room";
|
||||
set $upyun_cdn "https://upyun.dev.moicen.com/";
|
||||
set $wx_domain "dev.wx.moicen.com";
|
||||
set $upt_secret "C29DBA1F1EA4462088136C3A85C2FBFC";
|
||||
set $upt_duration 3600;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
@@ -77,6 +79,10 @@ server {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ server {
|
||||
set $upyun_directory "music-room";
|
||||
set $upyun_cdn "https://upyun.dev.moicen.com/";
|
||||
set $wx_domain "dev.wx.moicen.com";
|
||||
set $upt_secret "C29DBA1F1EA4462088136C3A85C2FBFC";
|
||||
set $upt_duration 3600;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
@@ -79,6 +81,10 @@ server {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ server {
|
||||
set $upyun_directory "music-room";
|
||||
set $upyun_cdn "https://upyun.moicen.com/";
|
||||
set $wx_domain "wx.moicen.com";
|
||||
set $upt_secret "C29DBA1F1EA4462088136C3A85C2FBFC";
|
||||
set $upt_duration 3600;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
@@ -85,6 +87,10 @@ server {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
local uri = ngx.var.arg_uri
|
||||
local secret = ngx.var.upt_secret
|
||||
local duration = ngx.var.upt_duration
|
||||
local etime = os.time() + duration
|
||||
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
||||
ngx.log(ngx.ERR, 'sign...' .. sign .. ' etime..' .. etime)
|
||||
local upt = string.sub(sign, 13, 13 + 7) .. etime
|
||||
ngx.say(upt)
|
||||
Reference in New Issue
Block a user