tweaking for tpotlight

This commit is contained in:
Marco Ochse 2023-05-27 14:49:20 +02:00
parent 9941818a6e
commit 87ef005c17
2 changed files with 62 additions and 31 deletions

View file

@ -7,6 +7,7 @@ load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so;
# OS ENV variables need to be defined here, so Lua can use them # OS ENV variables need to be defined here, so Lua can use them
env COCKPIT; env COCKPIT;
env TPOT_OSTYPE;
# Both modules are needed for Lua, in this exact order # Both modules are needed for Lua, in this exact order
load_module /usr/lib/nginx/modules/ndk_http_module.so; load_module /usr/lib/nginx/modules/ndk_http_module.so;
@ -18,10 +19,10 @@ events {
} }
http { http {
## ##
# Basic Settings # Basic Settings
## ##
resolver 127.0.0.11;
sendfile on; sendfile on;
tcp_nopush on; tcp_nopush on;
tcp_nodelay on; tcp_nodelay on;
@ -101,11 +102,11 @@ http {
'"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0 '"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0
'"pipe": "$pipe", ' # “p” if request was pipelined, “.” otherwise '"pipe": "$pipe", ' # “p” if request was pipelined, “.” otherwise
'"gzip_ratio": "$gzip_ratio", ' '"gzip_ratio": "$gzip_ratio", '
'"http_cf_ray": "$http_cf_ray"' '"http_cf_ray": "$http_cf_ray", '
'"proxy_host": "$proxy_host"'
'}'; '}';
access_log /var/log/nginx/access.log main_json; access_log /var/log/nginx/access.log main_json;
error_log /var/log/nginx/error.log;
## ##
# Virtual Host Configs # Virtual Host Configs

View file

@ -121,61 +121,91 @@ server {
try_files $uri $uri/ /cyberchef/index.html; try_files $uri $uri/ /cyberchef/index.html;
} }
################# #################
### Proxied sites ### Proxied sites
################# #################
### Kibana ### Kibana
location /kibana/ { location /kibana/ {
proxy_pass http://127.0.0.1:64296; set_by_lua_block $kibana {
local tpot_ostype = os.getenv("TPOT_OSTYPE")
if tpot_ostype == "mac" or tpot_ostype == "win" then
return "http://kibana:5601";
else
return "http://127.0.0.1:64296";
end
}
proxy_pass $kibana;
rewrite /kibana/(.*)$ /$1 break; rewrite /kibana/(.*)$ /$1 break;
} }
### ES ### ES
location /es/ { location /es/ {
proxy_pass http://127.0.0.1:64298/; set_by_lua_block $elasticsearch {
local tpot_ostype = os.getenv("TPOT_OSTYPE")
if tpot_ostype == "mac" or tpot_ostype == "win" then
return "http://elasticsearch:9200";
else
return "http://127.0.0.1:64298";
end
}
proxy_pass $elasticsearch;
rewrite /es/(.*)$ /$1 break; rewrite /es/(.*)$ /$1 break;
} }
### Map ### Map
location /map/ { location /map/ {
proxy_pass http://127.0.0.1:64299/; set_by_lua_block $map_web {
local tpot_ostype = os.getenv("TPOT_OSTYPE")
if tpot_ostype == "mac" or tpot_ostype == "win" then
return "http://map_web:64299";
else
return "http://127.0.0.1:64299";
end
}
proxy_pass $map_web;
rewrite /map/(.*)$ /$1 break; rewrite /map/(.*)$ /$1 break;
proxy_read_timeout 7200s;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_set_header Host $host; proxy_set_header Host $http_host;
proxy_redirect http:// https://;
} }
location /websocket { location /websocket {
proxy_pass http://127.0.0.1:64299; set_by_lua_block $map_web {
proxy_read_timeout 3600s; local tpot_ostype = os.getenv("TPOT_OSTYPE")
if tpot_ostype == "mac" or tpot_ostype == "win" then
return "http://map_web:64299";
else
return "http://127.0.0.1:64299";
end
}
proxy_pass $map_web;
proxy_read_timeout 7200s;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_set_header Host $host; proxy_set_header Host $http_host;
proxy_redirect http:// https://;
} }
### spiderfoot ### Spiderfoot
location /spiderfoot { set_by_lua_block $spiderfoot_backend {
proxy_pass http://127.0.0.1:64303; local tpot_ostype = os.getenv("TPOT_OSTYPE")
if tpot_ostype == "mac" or tpot_ostype == "win" then
return "http://spiderfoot:8080";
else
return "http://127.0.0.1:64303";
end
} }
location /spiderfoot/ {
location /static { proxy_pass $spiderfoot_backend;
proxy_pass http://127.0.0.1:64303/spiderfoot/static; proxy_set_header Host $http_host;
proxy_redirect http:// https://;
} }
location ~ ^/(static|scanviz|scandelete|scaninfo) {
location /scanviz { proxy_pass $spiderfoot_backend/spiderfoot/$1$is_args$args;
proxy_pass http://127.0.0.1:64303/spiderfoot/scanviz;
}
location /scandelete {
proxy_pass http://127.0.0.1:64303/spiderfoot/scandelete;
}
location /scaninfo {
proxy_pass http://127.0.0.1:64303/spiderfoot/scaninfo;
} }
} }