File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments