From 46135fb30cffaa005c1d871193308d084313f379 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 22 Jul 2020 13:15:03 +0300 Subject: [PATCH] Add trailing-slash redirect for /synapse-admin --- roles/matrix-synapse-admin/tasks/init.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/matrix-synapse-admin/tasks/init.yml b/roles/matrix-synapse-admin/tasks/init.yml index 1efba9a74..c8d74e044 100644 --- a/roles/matrix-synapse-admin/tasks/init.yml +++ b/roles/matrix-synapse-admin/tasks/init.yml @@ -15,7 +15,9 @@ - name: Generate Synapse Admin proxying configuration for matrix-nginx-proxy set_fact: matrix_synapse_admin_matrix_nginx_proxy_configuration: | - location ~ ^{{ matrix_synapse_admin_public_endpoint }}/?(.*) { + rewrite ^{{ matrix_synapse_admin_public_endpoint }}$ $scheme://$server_name{{ matrix_synapse_admin_public_endpoint }}/ permanent; + + location ~ ^{{ matrix_synapse_admin_public_endpoint }}/(.*) { {% if matrix_nginx_proxy_enabled|default(False) %} {# Use the embedded DNS resolver in Docker containers to discover the service #} resolver 127.0.0.11 valid=5s;