fail2ban
This commit is contained in:
parent
dc493d1ac1
commit
56dc8655f8
|
|
@ -9,7 +9,23 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [2291 80 443];
|
networking.firewall.allowedTCPPorts = [2291 80 443];
|
||||||
services.fail2ban.enable = true;
|
services.fail2ban = {
|
||||||
|
enable = true;
|
||||||
|
jails = {
|
||||||
|
"nginx".settings = {
|
||||||
|
filter = "nginx-4";
|
||||||
|
logpath = "/var/log/nginx/access.log";
|
||||||
|
backend = "auto";
|
||||||
|
maxretry = 8;
|
||||||
|
bantime = 600;
|
||||||
|
findtime = 120;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.etc."fail2ban/filter.d/nginx-4.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = ^<HOST> - - \[.*\] \".*\" (4..).+$
|
||||||
|
'';
|
||||||
services.qemuGuest.enable = true;
|
services.qemuGuest.enable = true;
|
||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -44,7 +60,7 @@
|
||||||
useACMEHost = "twoha.cc";
|
useACMEHost = "twoha.cc";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
serverName = "twoha.cc";
|
serverName = "twoha.cc";
|
||||||
locations."/".return = 502;
|
locations."/".return = 401;
|
||||||
};
|
};
|
||||||
virtualHosts."u.twoha.cc" = {
|
virtualHosts."u.twoha.cc" = {
|
||||||
useACMEHost = "twoha.cc";
|
useACMEHost = "twoha.cc";
|
||||||
|
|
@ -77,7 +93,7 @@
|
||||||
useACMEHost = "twoha.cc";
|
useACMEHost = "twoha.cc";
|
||||||
serverName = "*.twoha.cc";
|
serverName = "*.twoha.cc";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".return = 502;
|
locations."/".return = 401;
|
||||||
};
|
};
|
||||||
virtualHosts."g.twoha.cc" = {
|
virtualHosts."g.twoha.cc" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue