restore ngx variable config
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user