hydra: add robots.txt
Allow the main page, but deny everything else.
Martin Weinelt committed
Jan 12, 2025 at 03:07 UTC
abb78774c02935d9e3e90059fcbba4b73d39717b
1 file changed
+12
-1
build/hydra-proxy.nix
+12
-1
@@ -1,4 +1,8 @@
1
-{ config, ... }:
1
+{
2
+ config,
3
+ pkgs,
4
+ ...
5
+}:
6
7
{
8
networking.firewall.allowedTCPPorts = [
@@ -40,6 +44,13 @@
44
}
45
'';
46
47
+ # Ask robots not to scrape hydra, it has various expensive endpoints
48
+ locations."=/robots.txt".alias = pkgs.writeText "hydra.nixos.org-robots.txt" ''
49
+ User-agent: *
50
+ Disallow: /
51
+ Allow: /$
52
+ '';
53
+
54
locations."/" = {
55
proxyPass = "http://127.0.0.1:3000";
56
};