nextcloud: Redirect to URL nextcloud/ if ending slash is not given

Tests:

- Without the changes, typing https://<domain>/nextcloud does not work. With the
changes it redirects to https://<domain>/nextcloud/.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-07-25 16:02:28 -07:00 committed by James Valleroy
parent 66533a1af5
commit 1b95a565b0
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -18,6 +18,15 @@ Redirect 301 /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo
Alias /nextcloud/ /var/lib/nextcloud/
# Redirect /nextcloud to /nextcloud/.
<Location ~ ^/nextcloud$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/nextcloud$
RewriteRule .* /nextcloud/ [R=301,L]
</IfModule>
</Location>
<IfModule proxy_fcgi_module>
ProxyPassMatch "^/nextcloud/(.*\.php(/.*)?)$" "fcgi://localhost:9000/var/www/html/$1"
</IfModule>