Browse Source

Add error pages

master
Alex 1 year ago
parent
commit
7ee3d6caf2
Signed by: caskd GPG Key ID: F92BA85F61F4C173
  1. 3
      .gitmodules
  2. 1
      errpage
  3. 10
      tasks/main.yml
  4. 8
      templates/haproxy.conf.j2

3
.gitmodules

@ -0,0 +1,3 @@
[submodule "errpage"]
path = errpage
url = https://git.redxen.eu/RedXen/haproxy-errpages

1
errpage

@ -0,0 +1 @@
Subproject commit 0f655ca54fbe1519081cb3f45298d6e2a24938be

10
tasks/main.yml

@ -9,3 +9,13 @@
tags:
- haproxy
- config
- name: Copy error page overrides
copy:
src: '{{ role_path }}/errpage/'
dest: '/etc/haproxy/errors/'
follow: yes
notify: Run service actions
tags:
- haproxy
- config
- errorpages

8
templates/haproxy.conf.j2

@ -21,6 +21,14 @@ defaults
timeout http-keep-alive 240s
default-server resolvers local init-addr libc,none resolve-opts prevent-dup-ip check
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
resolvers local
nameserver unbound 127.0.0.1:53
resolve_retries 2