From 4acd3c5bd269899d03a0e7c3a45b0ef313e85f0e Mon Sep 17 00:00:00 2001 From: alltheseteeth <67934723+alltheseteeth@users.noreply.github.com> Date: Sat, 1 Aug 2020 23:33:39 +0000 Subject: [PATCH] added trailing slash fix to every nginx conf I could find (#1046) --- ansible/templates/nginx.conf | 3 +++ docker/federation/nginx.conf | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index eaaa6b79e..4f66292c3 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -60,6 +60,9 @@ server { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # Cuts off the trailing slash on URLs to make them valid + rewrite ^(.+)/+$ $1 permanent; + # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/docker/federation/nginx.conf b/docker/federation/nginx.conf index 2093297eb..573067981 100644 --- a/docker/federation/nginx.conf +++ b/docker/federation/nginx.conf @@ -17,6 +17,9 @@ http { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # Cuts off the trailing slash on URLs to make them valid + rewrite ^(.+)/+$ $1 permanent; + # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -57,6 +60,9 @@ http { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # Cuts off the trailing slash on URLs to make them valid + rewrite ^(.+)/+$ $1 permanent; + # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -97,6 +103,9 @@ http { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # Cuts off the trailing slash on URLs to make them valid + rewrite ^(.+)/+$ $1 permanent; + # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;