{% set sites = { 'future.porn': our_published_port, 'pgadmin.sbtp.xyz': 9095, 'rssapp.sbtp.xyz': 9096 } %} {% for site, port in sites.items() %} {{ site }} { # 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 %}