fcgiwrap upstream errors

Chris Cortese cortese.consulting at gmail.com
Sun Mar 1 09:29:21 MSK 2009


The new fcgiwrap is interesting, thanks.

No more 502 bad gateway, the browser now says simply "403" (the error I 
was getting on stdout already).

The new nginx error log msg is better too, although I still haven't 
solved this problem.  Here it is:

27211#0: *33 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, client: .. etc ...

Script is executable by all.

The relevant parts of config are:

fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SCRIPT_NAME /full/path/to/my/cgi-bin$fastcgi_script_name;

Note that my cgi-bin is higher up in the directory tree than my web 
document root.  Surely this is not a problem??  In Apache, this is 
accomplished with ServerAlias directive.

Also I notice on this page that the document_root must end in a slash.  
http://wiki.codemongers.com/NginxSimpleCGI  ... unclear how to know if 
that's part of my problem...


Chris


Grzegorz Nosek wrote:
> On sob, lut 28, 2009 at 01:52:21 -0800, Chris Cortese wrote:
>   
>> Hello,
>>     
>
> Hi,
>
>   
>> I'm still trying to get fcgiwrap to handle a hello, world perl cgi script.
>>     
>
> Care to post it here? Maybe it's a simple missed/double newline or some
> such?
>
>   
>> I run:
>>
>> spawn-fcgi -f /usr/local/bin/fcgiwrap -s /tmp/cgi.sock
>>
>> The first time I try to pull up my cgi-bin/test.pl file, I get:
>>
>> connect() to unix:/tmp/cgi.sock failed (13: Permission denied) while 
>> connecting to upstream
>>
>> Then I tried chmod o+w /tmp/cgi.sock
>>     
>
> Yes, the web server must have access to the socket.
>
>   
>> and then I get:
>>
>> upstream closed prematurely FastCGI stdout while reading response header 
>> from upstream
>>
>> ... I read most of the 42 results I got from querying the mailing list 
>> about this error.... to no avail.
>>     
>
> Please update fcgiwrap (I have just pushed a new snapshot with possibly
> better error reporting), and retry. If you get a 403 response, check your
> Nginx error log (fcgiwrap got the request but declined to run it for
> some reason). If it's still a 502, either Nginx is misconfigured, or
> something is badly broken in your CGI script (a CR on the hashbang line
> is one tricky mofo ;))
>
> If it doesn't help, post the relevant parts of your config.
>
> Best regards,
>  Grzegorz Nosek
>
>   






More information about the nginx mailing list