]> Untitled Git - lemmy.git/commitdiff
added trailing slash fix to every nginx conf I could find (#1046)
authoralltheseteeth <67934723+alltheseteeth@users.noreply.github.com>
Sat, 1 Aug 2020 23:33:39 +0000 (23:33 +0000)
committerGitHub <noreply@github.com>
Sat, 1 Aug 2020 23:33:39 +0000 (19:33 -0400)
ansible/templates/nginx.conf
docker/federation/nginx.conf

index eaaa6b79e0010960105df42af9e8c6e27e1b3dc9..4f66292c367a4d2d382bde702c7f1bc815a36021 100644 (file)
@@ -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;
index 2093297eb83f4ed191ec5f7dbafd3e1bfa50a017..573067981ae42661c6a5f693fe83578335f2e9a5 100644 (file)
@@ -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;