finish upyun upload issue

This commit is contained in:
moicen
2022-01-28 02:48:31 +08:00
parent 6f02e88c37
commit 2dbd3a9000
3 changed files with 6 additions and 14 deletions
+4
View File
@@ -14,6 +14,10 @@ server {
set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $resty_loc "/usr/local/openresty";
set $convert "/usr/bin/convert";
set $upyun_operator "moicen";
set $upyun_password "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN";
set $upyun_bucket "huiwing";
set $upyun_directory "music-room";
set $upyun_cdn "https://upyun.alchemy-studio.cn/";
location / {
-12
View File
@@ -9,18 +9,6 @@ server {
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
set $tmp_file_dir "/file_upload/"; # 文件存储路径
set $task_server "http://127.0.0.1:8080"; # task server host
set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $resty_loc "/usr/local/openresty";
set $convert "/usr/bin/convert";
set $upyun_operator "moicen";
set $upyun_password "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN";
set $upyun_bucket "huiwing";
set $upyun_directory "music-room";
set $upyun_cdn "https://upyun.alchemy-studio.cn/";
location / {
try_files $uri $uri/ /index.html;
proxy_set_header Host "music-room.moicen.com";
+2 -2
View File
@@ -97,7 +97,7 @@ end
local function upload(filepath)
local upyun, err = Upyun:new({
user = ngx.var.upyun_operator,
password = ngx.var.upyun_password,
passwd = ngx.var.upyun_password,
localFilePath = filepath
})
@@ -116,7 +116,7 @@ local function upload(filepath)
local info, err = upyun:upload_file(savePath, nil, nil)
if not info then
ngx.status = 502
ngx.log(ngx.ERR, "failed to upload image file : " .. err)
ngx.log(ngx.ERR, "failed to upload file : " .. err)
return
else
ngx.status = 200