From 0e2cd898902b6cf413175ef478e3d8eb0eb997df Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Sat, 18 Nov 2023 18:08:16 +0800 Subject: [PATCH] Add local debug openresty. --- .gitignore | 4 ++- Server/conf/nginx.conf | 67 +++++++++++++++++++++++++----------------- resource/deploy.sh | 6 +++- 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 252a924..16171bc 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,6 @@ target_wrapper.* # QtCreator CMake CMakeLists.txt.user* -build \ No newline at end of file +build +Server/logs +Server/conf/cert \ No newline at end of file diff --git a/Server/conf/nginx.conf b/Server/conf/nginx.conf index 343de1b..fb330d7 100644 --- a/Server/conf/nginx.conf +++ b/Server/conf/nginx.conf @@ -46,8 +46,8 @@ http { server 127.0.0.1:8083; } - upstream drone_server { - server 127.0.0.1:1080; + upstream speed_test { + server 127.0.0.1:8084; } init_by_lua_file lua/settings.lua; @@ -80,6 +80,10 @@ http { listen 443 ssl; server_name gitea.amass.fun; + client_header_timeout 120s; + client_body_timeout 120s; + client_max_body_size 512m; + ssl_certificate cert/gitea.amass.fun.pem; ssl_certificate_key cert/gitea.amass.fun.key; ssl_session_timeout 5m; #缓存有效期 @@ -96,25 +100,7 @@ http { server { listen 443 ssl; - server_name drone.amass.fun; - - ssl_certificate cert/8839053_drone.amass.fun.pem; - ssl_certificate_key cert/8839053_drone.amass.fun.key; - ssl_session_timeout 5m; #缓存有效期 - ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法 - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议 - ssl_prefer_server_ciphers on; #使用服务器端的首选算法 - - location / { - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://drone_server; - } - } - - server { - listen 443 ssl; - server_name amass.fun; + server_name 127.0.0.1; ssl_certificate cert/amass.fun.pem; ssl_certificate_key cert/amass.fun.key; @@ -170,6 +156,22 @@ http { proxy_pass http://local; } + location /speedtest { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-wiz-real-ip $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://speed_test; + } + location /backend { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-wiz-real-ip $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://speed_test; + } location /InstallerRepository { root .; index index.html index.htm; @@ -220,18 +222,29 @@ http { rewrite ^(.*)$ https://gitea.amass.fun$1 permanent; } - server { - listen 80; - server_name drone.amass.fun; - rewrite ^(.*)$ https://drone.amass.fun$1 permanent; - } - server { listen 80; server_name amass.fun; location /resource { root .; } + location /speedtest { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-wiz-real-ip $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://speed_test; + } + location /backend { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-wiz-real-ip $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://speed_test; + } + location / { rewrite ^(.*)$ https://amass.fun$1 permanent; } diff --git a/resource/deploy.sh b/resource/deploy.sh index 1161112..5c11944 100755 --- a/resource/deploy.sh +++ b/resource/deploy.sh @@ -63,4 +63,8 @@ function main() { esac } -main $@ \ No newline at end of file +main $@ + +# curl -k --insecure https://127.0.0.1/lua +# openresty -p Server +# sudo openresty -p Server -s reload \ No newline at end of file