mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Add Nginx Cockpit Awareness
This commit is contained in:
8
docker/nginx/dist/conf/nginx.conf
vendored
8
docker/nginx/dist/conf/nginx.conf
vendored
@ -5,6 +5,13 @@ load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;
|
||||
load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so;
|
||||
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
|
||||
env COCKPIT;
|
||||
|
||||
# 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/ngx_http_lua_module.so;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
@ -15,7 +22,6 @@ http {
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
|
13
docker/nginx/dist/conf/tpotweb.conf
vendored
13
docker/nginx/dist/conf/tpotweb.conf
vendored
@ -90,16 +90,23 @@ server {
|
||||
auth_basic "closed site";
|
||||
auth_basic_user_file /etc/nginx/nginxpasswd;
|
||||
|
||||
|
||||
#############################
|
||||
### T-Pot Landing Page & Apps
|
||||
#############################
|
||||
|
||||
location / {
|
||||
index index.html;
|
||||
set_by_lua_block $index_file {
|
||||
local cockpit = os.getenv("COCKPIT")
|
||||
if cockpit == "false" then
|
||||
return "index_light.html"
|
||||
else
|
||||
return "index.html"
|
||||
end
|
||||
}
|
||||
auth_basic "closed site";
|
||||
auth_basic_user_file /etc/nginx/nginxpasswd;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index $index_file;
|
||||
try_files $uri $uri/ /$index_file;
|
||||
}
|
||||
|
||||
location /elasticvue {
|
||||
|
Reference in New Issue
Block a user