ansible-role-traefik/templates/conf.d/80-onlyoffice.toml

52 lines
1.5 KiB
TOML

[http.middlewares.onlyoffice-headers.headers.customRequestHeaders]
X-Forwarded-Proto = "https"
[http.middlewares.onlyoffice-spellchecker-stripprefix.stripPrefix]
prefixes = ["/spellchecker"]
{% for r in traefik_onlyoffice %}
#---------------------------------
# onlyOffice: {{ r.name }}: {{ r.rule }}
#---------------------------------
[http.routers.{{ r.name }}-redir]
rule = "{{ r.rule }}"
entryPoints = ["web"]
middlewares = ["httpsRedirect"]
service = "{{ r.name }}@file"
[http.routers.{{ r.name }}]
rule = "{{ r.rule }}"
middlewares = ["onlyoffice-headers","httpsRedirect"]
entryPoints = ["websecure"]
service = "{{ r.name }}@file"
[http.routers.{{ r.name }}.tls]
certResolver = "my-resolver"
[http.services.{{ r.name }}.loadBalancer]
[http.services.{{ r.name }}.loadBalancer.healthCheck]
path = "/healthcheck"
interval = "10s"
timeout = "3s"
{% for url in r.service_url %}
[[http.services.{{ r.name }}.loadBalancer.servers]]
url = "{{ url }}:8000"
{% endfor %}
# onlyOffice-Spellchecker
[http.routers.{{ r.name }}-spell]
rule = "({{ r.rule }}) && PathPrefix(`/spellchecker`)"
middlewares = ["onlyoffice-spellchecker-stripprefix","onlyoffice-headers","httpsRedirect"]
entryPoints = ["websecure"]
service = "{{ r.name }}-spell@file"
[http.routers.{{ r.name }}-spell.tls]
certResolver = "my-resolver"
[http.services.{{ r.name }}-spell.loadBalancer]
{% for url in r.service_url %}
[[http.services.{{ r.name }}-spell.loadBalancer.servers]]
url = "{{ url }}:8080"
{% endfor %}
{% endfor %}