ansible-role-traefik/templates/conf.d/70-easy-proxy.toml

39 lines
904 B
TOML

{% for r in traefik_proxy %}
#---------------------------------
# {{ r.name }}: {{ r.rule }}
#---------------------------------
{% if r.tls %}
[http.routers.{{r.name}}-redir]
rule = "{{ r.rule }}"
entryPoints = ["web"]
middlewares = ["httpsRedirect"]
service = "{{r.name}}@file"
[http.routers.{{r.name}}-acme]
rule = "({{ r.rule }}) && PathPrefix(`/.well-known/acme-challenge/`)"
entryPoints = ["web"]
service = "{{r.name}}@file"
{% endif %}
[http.routers.{{r.name}}]
rule = "{{ r.rule }}"
{% if r.tls %}
entryPoints = ["websecure"]
{% else %}
entryPoints = ["web"]
{% endif %}
service = "{{r.name}}@file"
{% if r.tls %}
[http.routers.{{r.name}}.tls]
certResolver = "my-resolver"
{% endif %}
[http.services.{{ r.name }}.loadBalancer]
{% for url in r.service_url %}
[[http.services.{{ r.name }}.loadBalancer.servers]]
url = "{{ url }}"
{% endfor %}
{% endfor %}