Skip to content

Commit

Permalink
Add the acl whitelist in haproxy backend config
Browse files Browse the repository at this point in the history
  • Loading branch information
nuriel77 committed Jun 11, 2018
1 parent 6ea8ccc commit 1e58ac4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions roles/loadbalancer/templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ frontend iri_front
option log-separate-errors
option http-buffer-request

# Define source whitelist
{% if haproxy_whitelist_file is defined %}
# Define source whitelist{% if haproxy_whitelist_file is defined %}
acl whitelist src -f {{ haproxy_whitelist_file }}
{% else %}
acl whitelist src {{ haproxy_whitelist | join(" ") }}
Expand Down Expand Up @@ -110,6 +109,12 @@ backend iri_back
timeout server-fin 5m
filter compression

# Define source whitelist{% if haproxy_whitelist_file is defined %}
acl whitelist src -f {{ haproxy_whitelist_file }}
{% else %}
acl whitelist src {{ haproxy_whitelist | join(" ") }}
{% endif %}

stick-table type ip size 200k expire 30s store conn_rate(3s),http_req_rate(10s),conn_cur,sess_rate(3s)

# dynamic stuff for frontend + raise gpc0 counter
Expand Down

0 comments on commit 1e58ac4

Please sign in to comment.