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; } location / { proxy_intercept_errors on; proxy_pass http://localhost:8080; } location = /favicon.ico { root /var/www/html; } location = /static/favicon.png { root /var/www/html; } location ~ /(.*).git { fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; include fastcgi_params; fastcgi_param GIT_HTTP_EXPORT_ALL ""; fastcgi_param GIT_PROJECT_ROOT /home/git; fastcgi_param PATH_INFO $uri; fastcgi_pass unix:/var/run/fcgiwrap.socket; } }