server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name git.joshstock.in; rewrite ^/(.*)/$ /$1 permanent; # truncate forward slash error_page 404 /error-404.html; location = /error-404.html { root /var/www/html; } proxy_intercept_errors on; location / { proxy_pass http://localhost:8080; } location = /favicon.ico { # the only static file we want on this domain root /var/www/html; } }