Skip to content

Commit e1263b0

Browse files
committed
feat(config): support errorfiles
Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
1 parent 3bbea2d commit e1263b0

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

haproxy/templates/haproxy.jinja

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ listen {{ listener.get('name', listener_name) }}
320320
{%- endfor %}
321321
{%- endif %}
322322
{%- endif %}
323+
{%- if 'errorfiles' in listener %}
324+
errorfiles {{ listener.errorfiles }}
325+
{%- endif %}
323326
{%- if 'default_backend' in listener %}
324327
default_backend {{ listener.default_backend }}
325328
{%- endif %}
@@ -480,6 +483,9 @@ frontend {{ frontend.get('name', frontend_name) }}
480483
{%- endfor %}
481484
{%- endif %}
482485
{%- endif %}
486+
{%- if 'errorfiles' in frontend %}
487+
errorfiles {{ frontend.errorfiles }}
488+
{%- endif %}
483489
{%- if 'default_backend' in frontend %}
484490
default_backend {{ frontend.default_backend }}
485491
{%- endif %}
@@ -495,6 +501,9 @@ frontend {{ frontend.get('name', frontend_name) }}
495501
#------------------
496502
{%- for backend_name, backend in salt['pillar.get']('haproxy:backends', {})|dictsort %}
497503
backend {{ backend.get('name', backend_name) }}
504+
{%- if 'errorfiles' in backend %}
505+
errorfiles {{ backend.errorfiles }}
506+
{%- endif %}
498507
{%- if 'mode' in backend %}
499508
mode {{ backend.mode }}
500509
{%- endif %}

pillar.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ haproxy:
175175
- scheme https if !{ ssl_fc }
176176
reqadds:
177177
- "X-Forwarded-Proto:\\ http"
178+
errorfiles: corp
178179
httpresponses:
179180
- return:
180181
- status 503 errorfiles corp if { status 503 }

0 commit comments

Comments
 (0)