From c8d458f5f6a1e33ac008bf3e41769e0f5acc56cb Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 16 Feb 2025 23:11:22 -0800 Subject: [PATCH] Auto add / to the end of the URL Signed-off-by: Tamal Saha --- default.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/default.conf b/default.conf index f7dbd8245b..611c131e7e 100644 --- a/default.conf +++ b/default.conf @@ -4,6 +4,11 @@ server { #access_log /var/log/nginx/host.access.log main; + # check if request isn't static file + if ($request_filename !~* .[a-zA-Z0-9]+$ ) { + rewrite (^[^?]+[^/?])([^/]*)$ $1/$2 permanent; + } + location / { root /usr/share/nginx/html; index index.html index.htm;