set rate limits for searchix deployments
2 files changed, 26 insertions(+), 1 deletion(-)
changed files
M Caddyfile → Caddyfile
@@ -62,6 +62,28 @@ cache header -Server } +(rate_limit) { + rate_limit { + distributed + zone global_static { + match { + query query=* + } + key static + events 100 + window 1m + } + zone host_dynamic { + match { + query query=* + } + key {remote_host} + events 5 + window 10s + } + } +} + flynet-butterfly-1123.fly.dev { respond "Hello, world!" }@@ -92,6 +114,7 @@ } searchix.ovh { import cache + import rate_limit goatcounter { api_host https://stats.searchix.ovh@@ -125,6 +148,7 @@ } stable.searchix.ovh { import cache + import rate_limit goatcounter { api_host https://stats.stable.searchix.ovh
M Dockerfile → Dockerfile
@@ -7,7 +7,8 @@ --with github.com/caddyserver/cache-handler \ --with github.com/darkweak/storages/otter/caddy \ --with github.com/pberkel/caddy-storage-redis \ --with github.com/caddy-dns/rfc2136 \ - --with github.com/jarv/caddy-goatcounter + --with github.com/jarv/caddy-goatcounter \ + --with github.com/mholt/caddy-ratelimit FROM caddy:${CADDY_VERSION}-alpine AS runner