Browse Source

Return a custom page for 502 status codes

remove-logs
Andreas Linz 3 years ago
parent
commit
f2af46a1b3
3 changed files with 19 additions and 1 deletions
  1. +8
    -0
      roles/caddy/tasks/main.yml
  2. +8
    -0
      roles/caddy/templates/502.html.tmpl
  3. +3
    -1
      roles/caddy/templates/common.caddy.tmpl

+ 8
- 0
roles/caddy/tasks/main.yml View File

@ -51,6 +51,14 @@
group: "{{ caddy_group }}"
state: directory
mode: 0700
- name: Template error pages
become: true
template:
src: 502.html.tmpl
dest: /etc/caddy/502.html
owner: "{{ caddy_user }}"
group: "{{ caddy_group }}"
mode: 0400
- name: Configure caddy
become: true
template:

+ 8
- 0
roles/caddy/templates/502.html.tmpl View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<p>Please, come back in some minutes.</p>
<p>In case of emergency contact <a href="mailto:{{ user_email }}">{{ user_email }}</a></p>
</body>
</html>

+ 3
- 1
roles/caddy/templates/common.caddy.tmpl View File

@ -1,4 +1,6 @@
log / stdout {combined}
errors stderr
errors stderr {
502 /etc/caddy/502.html
}
prometheus
header / X-klingt-net-version "{{ domain_version }}"

Loading…
Cancel
Save