Skip to content
Snippets Groups Projects
Commit 15e69198 authored by jurgenhaas's avatar jurgenhaas
Browse files

Optimize frontend names and drop requests with no matching host

parent 4504034f
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ listen stats
stats uri /haproxy_stats
stats realm LoadBalancerStats
frontend http-in
frontend http_in
bind *:80
acl blockedip src -i -f /etc/haproxy/blacklist
http-request deny if blockedip
......@@ -66,7 +66,7 @@ frontend http-in
{% endfor %}
{% for cert in proxy_certificates %}
frontend https-in-{{ cert.ip }}
frontend https_in_{{ cert.ip }}
bind {{ cert.ip }}:443 ssl crt /etc/haproxy/certs/{{ cert.file }} no-sslv3
acl blockedip src -i -f /etc/haproxy/blacklist
http-request deny if blockedip
......@@ -93,7 +93,11 @@ frontend https-in-{{ cert.ip }}
{% for host in groups['all'] %}
backend backend_{{host}}
{% if host == inventory_hostname %}
http-response deny
{% else %}
server server_{{host}} {{hostvars[host]['static_ipv4']|default(hostvars[host]['ansible_default_ipv4']['address'])}}:80 maxconn 32
{% endif %}
{% endfor %}
{% if varnish_host|default(false) %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment