From af7b91674e625e96ecae52be715a1df667b2c111 Mon Sep 17 00:00:00 2001 From: moicen Date: Fri, 28 Jan 2022 21:24:53 +0800 Subject: [PATCH] restore ngx variable config --- conf/music-room.conf | 2 ++ scripts/test_upyun_upload.lua | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) 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