Trouble using gitweb with nginx

Posted by Rayne on Server Fault See other posts from Server Fault or by Rayne
Published on 2011-01-10T02:37:23Z Indexed on 2011/01/10 2:55 UTC
Read the original article Hit count: 328

Filed under:
|

I have a git repository in a directory inside of /home/raynes/pubgit/. I'm trying to use gitweb to provide a web interface to it. I use nginx as my web server for everything else, so I don't really want to have to use another just for this.

I'm mostly following this guide: http://michalbugno.pl/en/blog/gitweb-nginx, which is the only guide I can find via google and is really recent. fcgiwrap apparently isn't in Lucid Lynx's repositories, so I installed it manually. I spawn instances via spawn-fcgi:

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

That's all good. My /etc/gitweb.conf is as follows:

# 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";

And my nginx server configuration is this:

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;
    }
}

The only difference here is that I've set fastcgi_pass to 127.0.0.1:9001. When I go to http://mc.raynes.me I'm greeted with a page that simply says "403" and nothing else. I have not the slightest clue what I did wrong.

Any ideas?

© Server Fault or respective owner

Related posts about nginx

Related posts about gitweb