{% set sites = { 'future.porn': our_published_port, 'pgadmin.sbtp.xyz': pgadmin_published_port, 'rssapp.sbtp.xyz': rssapp_published_port } %} {% for site, port in sites.items() %} {{ site }} { {% if site == 'pgadmin.sbtp.xyz' %} basicauth { {{ pgadmin_basicauth_username }} {{ pgadmin_basicauth_password }} } {% endif %} # Define the upstream servers (docker swarm nodes) for load balancing reverse_proxy {% for host in groups['swarm'] %}{{ hostvars[host]['internal_ip'] }}:{{ port }} {% endfor %} { health_uri /health health_interval 10s health_timeout 5s } handle_errors { respond "💥 Error; Please try again later. Code {err.status_code} | {err.status_text}. Our code monkeys have been deployed to fix the issue~" } } {% endfor %}