| 1 | lua_package_path "/usr/local/lib/lua/5.1/?.lua;/srv/resty-gitweb/?.lua;;"; |
| 2 | lua_package_cpath "/usr/local/lib/lua/5.1/?.so;;"; |
| 3 |
|
| 4 | init_by_lua_file /srv/resty-gitweb/init.lua; |
| 5 |
|
| 6 | server { |
| 7 | listen 80; |
| 8 | listen [::]:80; |
| 9 | server_name git.localhost; |
| 10 | rewrite ^/(.*)/(\?.*)?$ /$1$2 permanent; |
| 11 | error_page 404 /404.html; location = /404.html { |
| 12 | root /var/www/josh/static/error; |
| 13 | } |
| 14 | location / { |
| 15 | default_type text/html; |
| 16 | content_by_lua_file /srv/resty-gitweb/app.lua; |
| 17 | } |
| 18 | location = /favicon.ico { |
| 19 | root /var/www/josh; |
| 20 | try_files /static/favicon.ico =404; |
| 21 | } |
| 22 | location ~ ^/([^\/]*)\.git { |
| 23 | fastcgi_pass unix:/var/run/fcgiwrap.socket; |
| 24 | include fastcgi_params; |
| 25 | fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; |
| 26 | fastcgi_param GIT_HTTP_EXPORT_ALL ""; |
| 27 | fastcgi_param GIT_PROJECT_ROOT /home/josh/repos; |
| 28 | fastcgi_param PATH_INFO $uri; |
| 29 | } |
| 30 | } |
| 31 |
|