More haproxy config options.

This commit is contained in:
Andrea Dell'Amico 2022-02-04 18:40:19 +01:00
parent 2ccf6a6978
commit 4b05619e7f
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 6 additions and 4 deletions

View File

@ -10,9 +10,11 @@ docker_swarm_haproxy_plain_http_api: True
docker_swarm_expose_api_via_haproxy: True
docker_swarm_expose_api_hostname: 'swarm.example.com'
docker_swarm_api_backend: 'dockersocket /var/run/docker.sock'
docker_swarm_api_check_availability: True
docker_swarm_api_accept_proxy: False
docker_swarm_api_check_availability: False
docker_swarm_api_networks_acl:
- '127.0.0.1/8'
docker_swarm_api_haproxy_mode: http
# Portainer
docker_swarm_cluster_portainer_install: True
docker_swarm_portainer_hostname: 'portainer-swarm.example.com'

View File

@ -115,12 +115,12 @@ frontend http
{% if docker_swarm_expose_api_via_haproxy %}
frontend docker_ft
{% if docker_swarm_haproxy_plain_http_api %}
bind :{{ docker_swarm_haproxy_swarm_port }} {% if docker_swarm_haproxy_installation_type == 'global' %}accept-proxy{% endif %}
bind :{{ docker_swarm_haproxy_swarm_port }} {% if docker_swarm_haproxy_installation_type == 'global' and docker_swarm_api_accept_proxy %}accept-proxy{% endif %}
{% else %}
bind :{{ docker_swarm_haproxy_swarm_port }} ssl crt {{ haproxy_cert_dir }} alpn h2,http/1.1 {% if docker_swarm_haproxy_installation_type == 'global' %}accept-proxy{% endif %}
bind :{{ docker_swarm_haproxy_swarm_port }} ssl crt {{ haproxy_cert_dir }} alpn h2,http/1.1 {% if docker_swarm_haproxy_installation_type == 'global' and docker_swarm_api_accept_proxy %}accept-proxy{% endif %}
{% endif %}
mode http
mode {{ docker_swarm_api_haproxy_mode }}
acl swarm_api hdr_dom(host) -i {{ docker_swarm_expose_api_hostname }}
acl swarm_api_allowed_nets src {% for net in docker_swarm_api_networks_acl %} {{ net }}{% endfor %}