cgit和nginx将索引页面作为一个存储库

我在nginx上使用cgit运行git版本库浏览器。
打开索引页面会导致显示No repositories found错误,而不是索引。 我相信这是因为foo.bar/被处理为foo.bar/cgit ,然后被解释为名称为“cgit”的git存储库,它不存在,因此是错误的。 我不知道我在这里做错了什么。

我的nginxconfiguration,与不相关的部分(如SSLconfiguration等)删除和地址/path清理匿名:

 server { listen 80; server_name git.foo.bar; return 301 https://git.foo.bar$request_uri; } server { listen 443 ssl http2; server_name git.foo.bar; # # ssl configs here # location ~* ^.+\.(css|png|ico)$ { root /foo/bar/htdocs; expires 30d; } location / { include fastcgi_params; fastcgi_pass unix:/foo/bar; fastcgi_index /; fastcgi_param DOCUMENT_ROOT /foo/bar/htdocs; fastcgi_param SCRIPT_FILENAME /foo/bar/cgit.cgi; fastcgi_param PATH_INFO $uri; fastcgi_param HTTP_HOST $server_name; } 

}

添加

 rewrite /cgi / break; 

location /块内解决这个特定的问题。