finish upyun upload issue
This commit is contained in:
@@ -14,6 +14,10 @@ server {
|
|||||||
set $htyuc "http://127.0.0.1:3000"; #htyuc host
|
set $htyuc "http://127.0.0.1:3000"; #htyuc host
|
||||||
set $resty_loc "/usr/local/openresty";
|
set $resty_loc "/usr/local/openresty";
|
||||||
set $convert "/usr/bin/convert";
|
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/";
|
set $upyun_cdn "https://upyun.alchemy-studio.cn/";
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
|||||||
@@ -9,18 +9,6 @@ server {
|
|||||||
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
|
||||||
|
|
||||||
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 / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
proxy_set_header Host "music-room.moicen.com";
|
proxy_set_header Host "music-room.moicen.com";
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ end
|
|||||||
local function upload(filepath)
|
local function upload(filepath)
|
||||||
local upyun, err = Upyun:new({
|
local upyun, err = Upyun:new({
|
||||||
user = ngx.var.upyun_operator,
|
user = ngx.var.upyun_operator,
|
||||||
password = ngx.var.upyun_password,
|
passwd = ngx.var.upyun_password,
|
||||||
localFilePath = filepath
|
localFilePath = filepath
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ local function upload(filepath)
|
|||||||
local info, err = upyun:upload_file(savePath, nil, nil)
|
local info, err = upyun:upload_file(savePath, nil, nil)
|
||||||
if not info then
|
if not info then
|
||||||
ngx.status = 502
|
ngx.status = 502
|
||||||
ngx.log(ngx.ERR, "failed to upload image file : " .. err)
|
ngx.log(ngx.ERR, "failed to upload file : " .. err)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
ngx.status = 200
|
ngx.status = 200
|
||||||
|
|||||||
Reference in New Issue
Block a user