Add local debug openresty.

This commit is contained in:
amass 2023-11-18 18:08:16 +08:00
parent 51518e89e0
commit 0e2cd89890
3 changed files with 48 additions and 29 deletions

2
.gitignore vendored
View File

@ -41,3 +41,5 @@ target_wrapper.*
# QtCreator CMake
CMakeLists.txt.user*
build
Server/logs
Server/conf/cert

View File

@ -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;
}

View File

@ -64,3 +64,7 @@ function main() {
}
main $@
# curl -k --insecure https://127.0.0.1/lua
# openresty -p Server
# sudo openresty -p Server -s reload