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