Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions haproxy/templates/haproxy.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ defaults
errorfile {{ errorfile_name }} {{ errorfile }}
{%- endfor %}
{% endif %}

{%- for error_name, error_files in salt['pillar.get']('haproxy:httperrors', {}) | dictsort %}
http-errors {{ error_name }}
{%- for code, file in error_files | dictsort %}
errorfile {{ code }} {{ file }}
{%- endfor %}
{%- endfor %}

{%- if salt['pillar.get']('haproxy:resolvers') %}


Expand Down
7 changes: 7 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ haproxy:
503: /etc/haproxy/errors/503.http
504: /etc/haproxy/errors/504.http

httperrors:
corp:
503: /etc/haproxy/errors/corp/503.http

resolvers:
local_dns:
options:
Expand Down Expand Up @@ -171,6 +175,9 @@ haproxy:
- scheme https if !{ ssl_fc }
reqadds:
- "X-Forwarded-Proto:\\ http"
httpresponses:
- return:
- status 503 errorfiles corp if { status 503 }
default_backend: www-backend

# www-https:
Expand Down
Loading