server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name git.joshstock.in; rewrite ^/(.*)/(\?.*)?$ /$1$2 permanent; error_page 404 /error-404.html; location = /error-404.html { root /var/www/html; } location / { default_type text/html; content_by_lua_file /home/ubuntu/resty-gitweb/app.lua; } 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; } }