# Gitweb

**URL:** <https://www.ruby-forum.com/t/gitweb/214471>\
**Category:** NGINX\
**Created:** [December 2, 2011, 2:47pm UTC](https://www.ruby-forum.com/t/gitweb/214471 "2011-12-02T14:47:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 2, 2011, 2:47pm UTC](https://www.ruby-forum.com/t/gitweb/214471/1 "2011-12-02T14:47:37Z")

</div>

Hy,

I am having a hard time getting cgi (gitweb) to work.  
That’s the relefvant part of my config:

location ~ /git(/.\*)  
{  
include /etc/nginx/fastcgi\_params;

```
fastcgi_pass unix:/var/run/fcgiwrap.socket;
    fastcgi_index gitweb.cgi;

fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
  fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/gitweb.cgi;

```

}

That’s nginx output:

2011/12/02 13:40:37 [error] 6046#0: \*1 FastCGI sent in stderr: “Cannot  
get script name, is DOCUMENT\_ROOT and SCRIPT\_NAME set and is the script  
executable?” while reading response header from upstream,

I am using debian squeeze. Any idea what I am doing wrong?

Posted at Nginx Forum:

> **[gitweb](https://forum.nginx.org/read.php?2,219481,219481#msg-219481)**
>
> Hy, I am having a hard time getting cgi (gitweb) to work. That's the relefvant part of my config: location ~ /git(/.\*) { include /etc/nginx/fastcgi\_params; fastcgi\_pass unix:/var/run/fcgiwrap.socket; fastcgi

---

<div class="post-metadata">

**Author:** ![CGIMan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@CGIMan](https://www.ruby-forum.com/u/CGIMan)\
**Post date:** [December 2, 2011, 10:30pm UTC](https://www.ruby-forum.com/t/gitweb/214471/2 "2011-12-02T22:30:13Z")

</div>

On Fri, Dec 02, 2011 at 08:46:49AM -0500, CGIMan wrote:

Hi there,

> I am having a hard time getting cgi (gitweb) to work.  
> That’s the relefvant part of my config:

nginx doesn’t “do” cgi, but it does do fastcgi. So you are using a  
separate program to map between the two…

> ```
> fastcgi_pass unix:/var/run/fcgiwrap.socket;
> fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/gitweb.cgi;
> 
> ```

> That’s nginx output:
> 
> 2011/12/02 13:40:37 [error] 6046#0: \*1 FastCGI sent in stderr: “Cannot  
> get script name, is DOCUMENT\_ROOT and SCRIPT\_NAME set and is the script  
> executable?” while reading response header from upstream,

…and it looks like that program cares about SCRIPT\_NAME and  
DOCUMENT\_ROOT, and presumably not about SCRIPT\_FILENAME.

So I’d guess that you want to remove the SCRIPT\_FILENAME line, and  
replace it with

fastcgi\_param SCRIPT\_NAME gitweb.cgi;  
fastcgi\_param DOCUMENT\_ROOT /usr/lib/cgi-bin;

Your fcgiwrap program may have more documentation on precisely what  
parameters it expects and needs. Possibly there should be an extra “/”,  
either at the end of one param or at the start of the other.

Good luck,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
