lua_package_path "/usr/local/lib/lua/5.1/?.lua;/srv/resty-gitweb/?.lua;;"; lua_package_cpath "/usr/local/lib/lua/5.1/?.so;;"; init_by_lua_file /srv/resty-gitweb/init.lua; server { listen 80; listen [::]:80; server_name git.localhost; rewrite ^/(.*)/(\?.*)?$ /$1$2 permanent; error_page 404 /404.html; location = /404.html { root /var/www/josh/static/error; } location / { default_type text/html; content_by_lua_file /srv/resty-gitweb/app.lua; } location = /favicon.ico { root /var/www/josh; try_files /static/favicon.ico =404; } location ~ ^/([^\/]*)\.git { fastcgi_pass unix:/var/run/fcgiwrap.socket; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; fastcgi_param GIT_HTTP_EXPORT_ALL ""; fastcgi_param GIT_PROJECT_ROOT /home/josh/repos; fastcgi_param PATH_INFO $uri; } }