diff --git a/music-room-dev.conf b/music-room-dev.conf index 0d15926..f33bbb2 100644 --- a/music-room-dev.conf +++ b/music-room-dev.conf @@ -9,8 +9,8 @@ server { ssl_certificate_key /etc/letsencrypt/live/test-music-room.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 $hty_uc_host "http://127.0.0.1:3000"; #htyuc host + set $task_server "https://test-music-room.com"; # task server host + set $htyuc "https://test-music-room.com"; #htyuc host set $resty_loc "/usr/local/openresty"; set $convert "/usr/bin/convert"; @@ -60,7 +60,7 @@ server { server { listen 80; - server_name test-music-room.moicen.com; + server_name "test-music-room.moicen.com"; location / { return 301 https://$host$request_uri; } diff --git a/music-room-test.conf b/music-room-test.conf index 04999e6..29a9dcb 100644 --- a/music-room-test.conf +++ b/music-room-test.conf @@ -49,8 +49,8 @@ server { # ➤ mkdir -p /usr/local/file_upload # ➤ sudo chown (whoami) /usr/local/file_upload set $tmp_file_dir "/usr/local/file_upload"; # 文件存储路径 - set $task_server "http://127.0.0.1:8080"; # task server host - set $hty_uc_host "http://127.0.0.1:8088"; #htyuc host + set $task_server "https://127.0.0.1:8080"; # task server host + set $htyuc "http://127.0.0.1:8088"; #htyuc host #set $resty_loc "/usr/local/openresty"; diff --git a/upload.lua b/upload.lua index 9f49da1..97a4854 100644 --- a/upload.lua +++ b/upload.lua @@ -15,7 +15,12 @@ local TaskTypes = { } local task_server = ngx.var.task_server -local hty_uc_host = ngx.var.hty_uc_host +local htyuc = ngx.var.htyuc + +ngx.log(ngx.INFO, "TASK_SERVER -> ", task_server) +ngx.log(ngx.INFO, "HTYUC -> ", htyuc) + + local file_dir = ngx.var.tmp_file_dir local file local file_name @@ -53,9 +58,9 @@ local function verifyJwtToken(encrypted_token) local http = require "resty.http" local httpc = http.new() - local remote_url = string.format("%s/api/v1/uc/verify_jwt_token", hty_uc_host) + local remote_url = string.format("%s/api/v1/uc/verify_jwt_token", htyuc) - ngx.log(ngx.INFO, 'htyuc remote_url -> ', remote_url) + ngx.log(ngx.INFO, 'HTYUC REMOTE_URL -> ', remote_url) ngx.log(ngx.INFO, 'Authorization -> ', encrypted_token) local res, err = httpc:request_uri( @@ -199,6 +204,10 @@ while true do body = body_text, } ) + if res == nil then + ngx.log(ngx.ERR, "FAILED TO CONNECT TO *TASK_SERVER*", err) + end + if 201 ~= res.status then ngx.log(ngx.ERR, "TASK CREATE *FAILED*", err) ngx.say(err)