麻烦使用gitweb与nginx

我在/ home / raynes / pubgit /目录中有一个git仓库。 我正在尝试使用gitweb来为它提供一个web界面。 我使用nginx作为我的networking服务器的一切,所以我真的不想只为此使用另一个。

我主要是遵循这个指南: http : //michalbugno.pl/en/blog/gitweb-nginx ,这是唯一的指导,我可以通过谷歌find,真的是最近。 fcgiwrap显然不在Lucid Lynx的仓库中,所以我手动安装了它。 我通过spawn-fcgi产生实例:

spawn-fcgi -f /usr/local/sbin/fcgiwrap -a 127.0.0.1 -p 9001 

这很好。 我的/etc/gitweb.conf如下:

 # path to git projects (<project>.git) $projectroot = "/home/raynes/pubgit"; $my_uri = "http://mc.raynes.me"; $home_link = "http://mc.raynes.me/"; # directory to use for temp files $git_temp = "/tmp"; # target of the home link on top of all pages #$home_link = $my_uri || "/"; # html text to include at home page $home_text = "indextext.html"; # file with project list; by default, simply scan the projectroot dir. $projects_list = $projectroot; # stylesheet to use $stylesheet = "/gitweb/gitweb.css"; # logo to use $logo = "/gitweb/git-logo.png"; # the 'favicon' $favicon = "/gitweb/git-favicon.png"; 

而我的nginx服务器configuration是这样的:

 server { listen 80; server_name mc.raynes.me; location / { root /usr/share/gitweb; if (!-f $request_filename) { fastcgi_pass 127.0.0.1:9001; } fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } } 

唯一的区别是我已经设置fastcgi_pass到127.0.0.1:9001。 当我去http://mc.raynes.me时,我会看到一个简单的说“403”的网页,没有其他的东西。 我没有丝毫的线索,我做错了什么。

有任何想法吗?

确保你的SCRIPT_FILENAME是正确的。 我发现我必须指定完整的绝对位置才能使其工作:

 fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi; 

如果你仍然有错误,你可能还需要指定你的Gitwebconfiguration文件的完整path:

 fastcgi_param GITWEB_CONFIG /etc/conf.d/gitweb.conf;