From d487c59c01226968a85ade0c0c3671f65455e284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sun, 28 Nov 2021 14:46:40 +0800 Subject: [PATCH] cleanup --- music-room-test.conf | 10 ++-------- upload.lua | 18 ++++++++---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/music-room-test.conf b/music-room-test.conf index 29a9dcb..970bc8f 100644 --- a/music-room-test.conf +++ b/music-room-test.conf @@ -34,11 +34,7 @@ # resty.index # site server { - # set $servername "music-room.alchemy-studio.cn"; - set $servername "test.localhost"; # set in your /etc/hosts -# server_name $servername; server_name "test.localhost"; - # listen 443 ssl; listen 8088; # disable in local test env @@ -51,9 +47,7 @@ server { set $tmp_file_dir "/usr/local/file_upload"; # 文件存储路径 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"; set $resty_loc "/usr/local/opt/openresty"; # MacOS set $convert "/usr/local/bin/convert"; @@ -89,11 +83,11 @@ server { location /api/v1/ws/ { proxy_pass http://127.0.0.1:3001/api/v1/ws/; - proxy_set_header Host $host; + proxy_set_header Host $host; } location /api/v1/uc/ { proxy_pass http://127.0.0.1:3000/api/v1/uc/; - proxy_set_header Host $host; + proxy_set_header Host $host; } location /api/v1/ts/ { proxy_pass http://127.0.0.1:8080/api/v1/ts/; diff --git a/upload.lua b/upload.lua index 97a4854..c385de3 100644 --- a/upload.lua +++ b/upload.lua @@ -77,16 +77,16 @@ local function verifyJwtToken(encrypted_token) if not res then ngx.status = ngx.HTTP_UNAUTHORIZED ngx.header.content_type = "application/json; charset=utf-8" - ngx.log(ngx.ERR, "Jwt token verify request error ! ") + ngx.log(ngx.ERR, "CAN'T VERIFY JWT TOKEN!") ngx.exit(ngx.HTTP_UNAUTHORIZED) else if 200 ~= res.status then - ngx.log(ngx.ERR, "Jwt token verify error ! ", err) + ngx.log(ngx.ERR, "JWT TOKEN VERIFICATION ERROR!", err) ngx.exit(res.status) end end - ngx.log(ngx.INFO, "Jwt token verify ok .") + ngx.log(ngx.INFO, "JWT TOKEN VERIFICATION PASSED.") end @@ -102,15 +102,14 @@ local function decodeJwtToken(encrypted_token) end ngx.log(ngx.INFO, "JWT: " .. cjson.encode(jwt_obj)) - ngx.log(ngx.INFO, "jwt object : payload : sub " .. jwt_obj.payload.sub) local htytoken = cjson.decode(jwt_obj.payload.sub) - ngx.log(ngx.INFO, "htytoken : token_id " .. htytoken.token_id) - ngx.log(ngx.INFO, "htytoken : hty_id " .. htytoken.hty_id) - ngx.log(ngx.INFO, "htytoken : app_id " .. htytoken.app_id) - ngx.log(ngx.INFO, "htytoken : ts " .. htytoken.ts) - ngx.log(ngx.INFO, "htytoken : roles " .. htytoken.roles) + ngx.log(ngx.INFO, "HTY_TOKEN : token_id " .. htytoken.token_id) + ngx.log(ngx.INFO, "HTY_TOKEN : hty_id " .. htytoken.hty_id) + ngx.log(ngx.INFO, "HTY_TOKEN : app_id " .. htytoken.app_id) + ngx.log(ngx.INFO, "HTY_TOKEN : ts " .. htytoken.ts) + ngx.log(ngx.INFO, "HTY_TOKEN : roles " .. htytoken.roles) return htytoken end @@ -150,7 +149,6 @@ while true do --end if type == "header" then - --"Content-Disposition","form-data; name=\"files[]\"; filename=\"Song-of-joy.png\"" --"Content-Type","image\/png" local key = res[1]