2020-11-27 12:39:51 +01:00
|
|
|
{% 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 %}
|
2020-11-27 13:48:46 +01:00
|
|
|
entryPoints = ["websecure"]
|
2020-11-27 12:39:51 +01:00
|
|
|
{% else %}
|
2020-11-27 13:48:46 +01:00
|
|
|
entryPoints = ["web"]
|
|
|
|
{% endif %}
|
|
|
|
{% if "corsAll" in r and r.corsAll %}
|
|
|
|
middlewares = ["corsAll"]
|
2020-11-27 12:39:51 +01:00
|
|
|
{% 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 %}
|