Skip to content

Commit

Permalink
Auto add / to the end of the URL
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Feb 17, 2025
1 parent 64c52a5 commit c8d458f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c8d458f

Please sign in to comment.