Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running a Debian server with nginx chrooted in /var/chroot/nginx. It works wonderfully, but I'd like to be able to run cgit and host my gitolite repositories.

When it was out of the chroot it would give me the same error as it is giving me now, which is this:

2012/12/08 14:25:19 [error] 9179#0: *3 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'm fairly sure that this is a problem with fastcgi... here are the relevant lines in my nginx.conf:

server {
    listen 80;
    server_name git.url.tld;
    access_log /var/log/nginx/cgit.access.log;
    error_log /var/log/nginx/cgit.error.log;
    root /var/www/htdocs/cgit;

        location ~* ^.+\.(css|png|ico)$ {
            root /var/www/htdocs/cgit;
            expires 30d;
        }

        location / {
    root /var/www/htdocs/cgit;
            fastcgi_param   SCRIPT_NAME     cgit.cgi;
    fastcgi_param   DOCUMENT_ROOT   /var/www/htdocs/cgit;
            fastcgi_param   PATH_INFO       $uri;
            fastcgi_param   QUERY_STRING    $args;
            fastcgi_pass    unix:/tmp/cgi.sock;
        }  
    }

Any clues? Fastcgi, fcgi-wrap, etc. are all outside of the chroot, because having cgit, fastcgi, and gitolite in the chroot seemed a bit excessive. fastcgi has a socket open at /var/chroot/nginx/tmp/cgi.sock.

Thanks for your help!!

share|improve this question
    
May be related with serverfault.com/questions/334127/… and stackoverflow.com/questions/14304922/… but none solved the issue for me :( –  gueux Jan 13 '13 at 18:52

1 Answer 1

This is probably a bug with the version of fcgiwrap found on debian squeeze (1.0-1+squeeze1). See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698071

Upgrading to fcgiwrap 1.0.3-3 solved the issue for me.

share|improve this answer

Your Answer

 
discard

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.