2021-04-17 02:44:20 +00:00
|
|
|
http:
|
|
|
|
routers:
|
|
|
|
{{ item.name }}:
|
|
|
|
rule: "Host(`{{ item.domain }}`)"
|
|
|
|
service: {{ item.name }}-service
|
|
|
|
{% if item.basicauth is defined and item.middlewares is defined %}
|
|
|
|
middlewares: "{{ item.middlewares }},{{ item.name }}-auth@file"
|
|
|
|
{% elif item.basicauth is defined %}
|
|
|
|
middlewares: "{{ item.name }}-auth@file"
|
|
|
|
{% elif item.middlewares is defined %}
|
|
|
|
middlewares: "{{ item.middlewares }}"
|
|
|
|
{% endif %}
|
2022-08-19 04:51:05 +00:00
|
|
|
{% if traefik_acme_email is defined %}
|
2021-04-17 02:44:20 +00:00
|
|
|
tls:
|
|
|
|
certResolver: letsencrypt
|
|
|
|
domains:
|
|
|
|
- main: "{{ item.domain }}"
|
2022-08-19 04:51:05 +00:00
|
|
|
{% endif %}
|
2021-04-17 02:44:20 +00:00
|
|
|
entryPoints:
|
|
|
|
- "websecure"
|
|
|
|
services:
|
|
|
|
{{ item.name }}-service:
|
|
|
|
loadBalancer:
|
|
|
|
{% if item.httpsbackend is defined %}
|
|
|
|
serversTransport: {{ item.name }}-httpsbackend
|
|
|
|
servers:
|
|
|
|
- url: "{{ item.backend }}"
|
|
|
|
{% endif %}
|
|
|
|
{% if item.httpsbackend is defined %}
|
|
|
|
serversTransports:
|
|
|
|
{{ item.name }}-httpsbackend:
|
|
|
|
insecureSkipVerify: true
|
|
|
|
{% endif %}
|
|
|
|
{% if item.basicauth is defined %}
|
|
|
|
middlewares:
|
|
|
|
{{ item.name }}-auth:
|
|
|
|
basicAuth:
|
|
|
|
users:
|
|
|
|
{% for user in item.basicauth %}
|
|
|
|
- "{{ user }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|