Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:, 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 -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 = "";
$home_link = "";

# 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;
    location / {
        root /usr/share/gitweb;
        if (!-f $request_filename) {
        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 When I go to 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?

share|improve this question
Check your error log. – Martin Fjordvald Jan 10 '11 at 16:26
up vote 3 down vote accepted

Ensure that your SCRIPT_FILENAME is correct. I've found that I have to specify the full absolute location to get it work:

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

If you continue to have errors, you may need to specify the full path to your Gitweb configuration file as well:

fastcgi_param  GITWEB_CONFIG    /etc/conf.d/gitweb.conf;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.