@cryptotaxi247 / infra / commits / 22ed9aa2

hydra-proxy: serve branded 403 page

and give hints on how to resolve the block.

Martin Weinelt committed May 14, 2025 at 18:45 UTC 22ed9aa2ebc87c5e51168dba5b52312f715afc7e
2 files changed +80 -1
build/hydra-proxy.nix
+2 -1
@@ -65,9 +65,10 @@ in
65 enableACME = true;
66
67 extraConfig = ''
68 + error_page 403 /403.html;
69 error_page 502 /502.html;
70 error_page 503 /503.html;
70 - location ~ /(502|503).html {
71 + location ~ /(403|502|503).html {
72 root ${./nginx-error-pages};
73 internal;
74 }
build/nginx-error-pages/403.html new
+78
@@ -0,0 +1,78 @@
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <title>Error 403 - hydra.nixos.org</title>
5 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 + <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
7 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8 + <link
9 + rel="stylesheet"
10 + href="https://nixos.org/bootstrap/css/bootstrap.min.css"
11 + />
12 + <link
13 + rel="stylesheet"
14 + href="https://nixos.org/bootstrap/css/bootstrap-responsive.min.css"
15 + />
16 + <style>
17 + body {
18 + padding-top: 0;
19 + margin-top: 4em;
20 + margin-bottom: 4em;
21 + }
22 + body > div {
23 + max-width: 800px;
24 + text-align: center;
25 + }
26 + h1 {
27 + margin: 0 auto;
28 + text-align: center;
29 + }
30 + p {
31 + text-align: center;
32 + }
33 + ul {
34 + display: inline-block;
35 + text-align: left;
36 + }
37 + </style>
38 + </head>
39 + <body>
40 + <div class="container jumbotron">
41 + <div class="jumbotron">
42 + <p class="lead">
43 + <a href="https://nixos.org/nixos">
44 + <img
45 + src="https://nixos.org/logo/nixos-hires.png"
46 + width="500px"
47 + alt="logo"
48 + />
49 + </a>
50 + </p>
51 +
52 + <h1>HTTP Error 403</h1>
53 +
54 + <p class="lead">Access to this resource has been denied!</p>
55 + <p>
56 + This could be caused by one of the following issues:
57 + </p>
58 + <ul>
59 + <li>You are using an extension to spoof your user-agent</li>
60 + <li>The browser you are running is out of date</li>
61 + </ul>
62 + <p>
63 + Feel free to reach out, if you think this request was denied in error.
64 + </p>
65 + </div>
66 + <hr>
67 + <div class="help">
68 + <p>
69 + You can check the following resources for further informations:<br>
70 + <a href="https://prometheus.nixos.org/alerts">Alerts</a> |
71 + <a href="https://grafana.nixos.org/">Dashboards</a> |
72 + <a href="https://github.com/NixOS/infra/issues">Issues</a> |
73 + <a href="https://matrix.to/#/#infra:nixos.org">Chatroom</a>
74 + </p>
75 + </div>
76 + </div>
77 + </body>
78 +</html>