From 9696e18a9ff9d710876174085500ed1d2b024b03 Mon Sep 17 00:00:00 2001 From: moicen Date: Fri, 21 Jan 2022 03:22:54 +0800 Subject: [PATCH] update nginx config --- conf/admin.conf | 12 +++++------- conf/ts.conf | 3 --- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/conf/admin.conf b/conf/admin.conf index fbb4c16..e45f421 100644 --- a/conf/admin.conf +++ b/conf/admin.conf @@ -14,6 +14,7 @@ server { set $htyuc "http://127.0.0.1:3000"; #htyuc host set $resty_loc "/usr/local/openresty"; set $convert "/usr/bin/convert"; + set $script_path "/home/alchemy/resty_functions/scripts"; location / { try_files $uri $uri/ /index.html; @@ -28,9 +29,6 @@ server { root $resty_loc/nginx/html/admin; index index.html; - if ($http_origin !~ [a-z]+\.moicen\.com$) { - return 403; - } add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'Authorization,unionid,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; @@ -42,19 +40,19 @@ server { #Upload image files location /api/ngx/image/upload { - content_by_lua_file $resty_loc/resty_funcs/upload.lua; + content_by_lua_file $script_path/upload.lua; } #Combine image files location /api/ngx/image/combine { - content_by_lua_file $resty_loc/resty_funcs/combine.lua; + content_by_lua_file $script_path/combine.lua; } #Audio file download location /api/ngx/audio/upload { - content_by_lua_file $resty_loc/resty_funcs/upload_audio.lua; + content_by_lua_file $script_path/upload_audio.lua; } #Audio file convert location /api/ngx/audio/convert { - content_by_lua_file $resty_loc/resty_funcs/convert_audio.lua; + content_by_lua_file $script_path/convert_audio.lua; } location /api/v1/ws/ { diff --git a/conf/ts.conf b/conf/ts.conf index cad7a03..af01256 100644 --- a/conf/ts.conf +++ b/conf/ts.conf @@ -29,9 +29,6 @@ server { location /api/v1/ts/ { - if ($http_origin !~ [a-z]+\.moicen\.com$) { - return 403; - } add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'Authorization,HtyAdminToken,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';