This commit is contained in:
2021-11-28 11:09:36 +08:00
parent e2b9b33f4a
commit 6e4207617a
3 changed files with 17 additions and 8 deletions
+3 -3
View File
@@ -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;
}
+2 -2
View File
@@ -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";
+12 -3
View File
@@ -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)