{% extends "base.html" %} {% block title %}Routes{% endblock %} {% macro server_row(route, sname, addr) %} {% set be = backend_name(route) %} {% set st = (status or {}).get(be, {}).get(sname) %} {% set s = (st.status if st else ('not live' if route.enabled else 'disabled')) %} {% set cls = s | status_class %}
  • {{ s }} {{ addr }} {% if st %} {{ st.sessions }} active {% for state, label in [('ready', 'Ready'), ('drain', 'Drain'), ('maint', 'Maintenance')] %}
    {% endfor %}
    {% endif %}
  • {% endmacro %} {% block content %}

    Routes

    Which hostnames and ports go to which servers. Edits are staged until you apply them.

    Add HTTPS route Add HTTP route Add TCP route
    {% if status is none %} {% endif %} {% if not routes %}

    No routes yet

    Start with an HTTPS route, for example mail.andykemp.com and autodiscover.andykemp.com to your prod Exchange server on 192.168.1.10:443.

    The first apply replaces /etc/haproxy/haproxy.cfg with a HAPMan-managed file. The old one is kept as a backup.

    {% endif %} {% for kind, label in KINDS.items() %} {% set group = routes | selectattr('kind', 'equalto', kind) | list %} {% if group %}

    {{ label }}

    {% for r in group %}

    {{ r.name }} {% if r.is_default %}default{% endif %} {% if not r.enabled %}disabled{% endif %}

    {% if kind == 'tcp' %} port {{ r.listen_port }} {% else %} {% for h in split_list(r.hostnames) %}{{ h }}{% endfor %} {% if r.is_default and not r.hostnames %}any other name{% endif %} {% endif %}
    Edit
      {% for sname, addr in server_names(r) %}{{ server_row(r, sname, addr) }}{% endfor %}

    {{ BALANCE[r.balance] }} · health check: {{ CHECKS[r.check_mode] }}{% if r.check_path %} {{ r.check_path }}{% endif %} {% if r.notes %} · {{ r.notes }}{% endif %}

    {% endfor %}
    {% endif %} {% endfor %} {% if status %}

    Drain and Maintenance are runtime-only: they last until the next apply or HAProxy restart.

    {% endif %} {% endblock %}