diff --git a/conf/music-room.conf b/conf/music-room.conf index 01a7262..d734533 100644 --- a/conf/music-room.conf +++ b/conf/music-room.conf @@ -5,6 +5,8 @@ server { listen 443 ssl; client_max_body_size 10M; + 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 diff --git a/scripts/test_upyun_upload.lua b/scripts/test_upyun_upload.lua index 48576d0..abff93d 100644 --- a/scripts/test_upyun_upload.lua +++ b/scripts/test_upyun_upload.lua @@ -5,18 +5,17 @@ local cjson = require "cjson" local function upyun_upload_file() local config = { - user = "moicen", --授权操作员名称 - passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN", --操作员密码 + user = ngx.var.upyun_operator, + passwd = ngx.var.upyun_password, localFilePath = "/file_upload/abc.mp3" } local upyun = yun:new(config) + local bucket = ngx.var.upyun_bucket + local directory = 'test' + local savePath = bucket .. "/" .. directory .. "/abc.mp3" - local savePath = "huiwing/test/abc.mp3" - local gmkerl = nil - local options = nil - - local info, err = upyun:upload_file(savePath, gmkerl, options) + local info, err = upyun:upload_file(savePath, nil, nil) if not info then ngx.say("failed to upload image file : " .. err) return