From 7293ea47717c49d66651edef02c5c8def7df9333 Mon Sep 17 00:00:00 2001 From: bai Date: Fri, 24 Jul 2020 05:30:23 -0400 Subject: Optimizado listado de bans para nginx usando el módulo geo --- cgi/templates/bans_geo | 14 ++++++++++++++ cgi/templates/bans_locations | 10 ++++++++++ cgi/templates/bansconf | 7 ------- 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 cgi/templates/bans_geo create mode 100644 cgi/templates/bans_locations delete mode 100644 cgi/templates/bansconf (limited to 'cgi/templates') diff --git a/cgi/templates/bans_geo b/cgi/templates/bans_geo new file mode 100644 index 0000000..64687e8 --- /dev/null +++ b/cgi/templates/bans_geo @@ -0,0 +1,14 @@ +geo $bans_global { + default 0; + + #{ip} 1; + +} + +geo $bans_#{board} { + default 0; + + #{ip} 1; + +} + diff --git a/cgi/templates/bans_locations b/cgi/templates/bans_locations new file mode 100644 index 0000000..a514ccf --- /dev/null +++ b/cgi/templates/bans_locations @@ -0,0 +1,10 @@ + +location /#{board}/ { + + if ($bans_global) { rewrite ^ /cgi/banned; } + + + if ($bans_#{board}) { rewrite ^ /cgi/banned; } + +} + diff --git a/cgi/templates/bansconf b/cgi/templates/bansconf deleted file mode 100644 index 07e8afd..0000000 --- a/cgi/templates/bansconf +++ /dev/null @@ -1,7 +0,0 @@ - -location /#{board}/ { - - deny #{ip}; - -} - -- cgit v1.2.1-18-gbd029