Skip to content

Commit 873f07c

Browse files
committed
doc: add helpful comments in config, add trimming modifiers to fix whitespace
1 parent e94a197 commit 873f07c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

salt/haproxy/config/haproxy.cfg.jinja

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,13 @@ frontend main
126126
# constrained to the host header using the domain key in haproxy.sls
127127
# then adds a rule to deny via HTTP 429 if the respective ACL is matched and the stick table http request rate
128128
# is higher than the 'rate_limit' from haproxy.sls pillar date
129-
{% for service, config in haproxy.services.items() %}
130-
{% if config.get('rate_limit') %}
129+
{%- for service, config in haproxy.services.items() %}
130+
{%- if config.get('rate_limit') %}
131+
# Rate limit config for {{ service }}
131132
acl is_{{ service }} hdr(host) -i {% for domain in config.domains %}{{ domain }}{% endfor %}
132133
http-request deny deny_status 429 if is_{{ service }} { sc0_http_req_rate() gt {{ config.rate_limit }} }
133-
{% endif %}
134-
{% endfor %}
134+
{%- endif %}
135+
{%- endfor %}
135136

136137
# Custom logging format, this is the same as the normal "httplog" in
137138
# HAProxy except information about the TLS connection is included.

0 commit comments

Comments
 (0)