hydra: show branded 502 error page with helpful links
Martin Weinelt committed
Jan 12, 2025 at 03:06 UTC
4f07c39ee4b15940f48f7f230abc072631883ff6
2 files changed
+65
-1
build/hydra-proxy.nix
+2
-1
@@ -32,8 +32,9 @@
32
enableACME = true;
33
34
extraConfig = ''
35
+ error_page 502 /502.html;
36
error_page 503 /503.html;
36
- location = /503.html {
37
+ location ~ /(502|503).html {
38
root ${./nginx-error-pages};
39
internal;
40
}
build/nginx-error-pages/502.html
new
+63
@@ -0,0 +1,63 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+ <head>
4
+ <title>Error 502 - 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
+ }
25
+ h1 {
26
+ margin: 0 auto;
27
+ text-align: center;
28
+ }
29
+ p {
30
+ text-align: center;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body>
35
+ <div class="container jumbotron">
36
+ <div class="jumbotron">
37
+ <p class="lead">
38
+ <a href="https://nixos.org/nixos">
39
+ <img
40
+ src="https://nixos.org/logo/nixos-hires.png"
41
+ width="500px"
42
+ alt="logo"
43
+ />
44
+ </a>
45
+ </p>
46
+
47
+ <h1>HTTP Error 502</h1>
48
+
49
+ <p class="lead">This service is currently unavailable!</p>
50
+ </div>
51
+ <hr>
52
+ <div class="help">
53
+ <p>
54
+ You can check the following resources for further informations:<br>
55
+ <a href="https://prometheus.nixos.org/alerts">Alerts</a> |
56
+ <a href="https://grafana.nixos.org/">Dashboards</a> |
57
+ <a href="https://github.com/NixOS/infra/issues">Issues</a> |
58
+ <a href="https://matrix.to/#/#infra:nixos.org">Chatroom</a>
59
+ </p>
60
+ </div>
61
+ </div>
62
+ </body>
63
+</html>