diff --git a/system/podman/redmage.nix b/system/podman/redmage.nix index c2b8175..2af29ae 100644 --- a/system/podman/redmage.nix +++ b/system/podman/redmage.nix @@ -14,6 +14,13 @@ in { config = mkIf (podman.enable && podman.${name}.enable) { services.caddy.virtualHosts.${domain}.extraConfig = '' + @botForbidden header_regexp User-Agent "(?i)AdsBot-Google|Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|DataForSeoBot|Diffbot|FacebookBot|Google-Extended|GPTBot|ImagesiftBot|magpie-crawler|omgili|Omgilibot|peer39_crawler|PerplexityBot|YouBot" + + handle @botForbidden { + respond /* "Access Denied" 403 { + close + } + } reverse_proxy ${ip}:8080 '';