server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name start.joshstock.in; rewrite ^/(.*)/$ /$1 permanent; # truncate forward slash root /var/www/startpage; error_page 404 /error-404.html; location = /error-404.html {} location = / { index index.html; } location / { try_files $uri $uri.html =404; } }