restore ngx variable config
This commit is contained in:
@@ -5,6 +5,8 @@ server {
|
|||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
client_max_body_size 10M;
|
client_max_body_size 10M;
|
||||||
|
|
||||||
|
set $resty_loc "/usr/local/openresty";
|
||||||
|
|
||||||
# disable in local test env
|
# disable in local test env
|
||||||
ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot
|
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
|
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 function upyun_upload_file()
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
user = "moicen", --授权操作员名称
|
user = ngx.var.upyun_operator,
|
||||||
passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN", --操作员密码
|
passwd = ngx.var.upyun_password,
|
||||||
localFilePath = "/file_upload/abc.mp3"
|
localFilePath = "/file_upload/abc.mp3"
|
||||||
}
|
}
|
||||||
|
|
||||||
local upyun = yun:new(config)
|
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 info, err = upyun:upload_file(savePath, nil, nil)
|
||||||
local gmkerl = nil
|
|
||||||
local options = nil
|
|
||||||
|
|
||||||
local info, err = upyun:upload_file(savePath, gmkerl, options)
|
|
||||||
if not info then
|
if not info then
|
||||||
ngx.say("failed to upload image file : " .. err)
|
ngx.say("failed to upload image file : " .. err)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user