Skip to content

Commit

Permalink
Merge pull request #169 from NixOS/rate-limit
Browse files Browse the repository at this point in the history
rate limit wiki
  • Loading branch information
Mic92 authored Jan 4, 2025
2 parents 2003bc8 + c0373a2 commit 590fa23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nixos-wiki/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,16 @@ in
80
];
security.acme.acceptTerms = true;
services.nginx.appendHttpConfig = ''
limit_req_zone $binary_remote_addr zone=ip:20m rate=5r/s;
limit_req_status 429;
'';
services.nginx.virtualHosts.${config.services.mediawiki.nginx.hostName} = {
enableACME = lib.mkDefault true;
forceSSL = lib.mkDefault true;
extraConfig = ''
limit_req zone=ip burst=20 nodelay;
'';
locations."=/nixos.png".alias = ./nixos.png;
locations."=/favicon.ico".alias = ./favicon.ico;
locations."=/robots.txt".alias = ./robots.txt;
Expand Down

0 comments on commit 590fa23

Please sign in to comment.