1
0
Fork 0

Make slashless-redirect safer

This commit is contained in:
Slavi Pantaleev 2023-04-03 15:24:50 +03:00
parent 74845395e3
commit 04eb6cee8b

View file

@ -8,7 +8,7 @@ traefik.docker.network={{ nextcloud_container_labels_traefik_docker_network }}
{% set middlewares = [] %} {% set middlewares = [] %}
{% if nextcloud_container_labels_traefik_path_prefix != '/' %} {% if nextcloud_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.{{ nextcloud_identifier }}-slashless-redirect.redirectregex.regex=({{ nextcloud_container_labels_traefik_path_prefix | quote }})$ traefik.http.middlewares.{{ nextcloud_identifier }}-slashless-redirect.redirectregex.regex=^({{ nextcloud_container_labels_traefik_path_prefix | quote }})$
traefik.http.middlewares.{{ nextcloud_identifier }}-slashless-redirect.redirectregex.replacement=${1}/ traefik.http.middlewares.{{ nextcloud_identifier }}-slashless-redirect.redirectregex.replacement=${1}/
{% set middlewares = middlewares + [nextcloud_identifier + '-slashless-redirect'] %} {% set middlewares = middlewares + [nextcloud_identifier + '-slashless-redirect'] %}
{% endif %} {% endif %}