fastcgi_index - am I missing something obvious?

Francis Daly francis at
Wed Oct 15 23:02:11 UTC 2014

On Wed, Oct 15, 2014 at 01:17:49PM +0200, Sandra Snan wrote:

Hi there,

> So I have the same setup on two different servers, using fcgiwrap to
> serve some basic classic style cgi scripts.

Presumably the setups are only "nearly" the same, or else they would
respond the same way.

What version of fcgiwrap do you run on each server?

Can you show the output of "grep SCRIPT /etc/nginx/fastcgi_params"
on the servers? (One output is fine, if the two are identical.)

> But only on one of them, http://serverdomain.whatever/cgi-bin/ takes me
> to the index.cgi. On the other I get a 502.

What is the output of "curl -i http://serverdomain.whatever/cgi-bin/",
especially on the failing server?

(That's basically "have you cleared your browser cache?", but is more

> What am I missing?
> I think the unix permissions of /usr/lib, /usr/lib/cgi-bin and its
> contents, and /var/www are the same on both servers.

Since a request for /cgi-bin/index.cgi succeeds, they almost certainly
are both correct; but the output of

ls -ldZ /
ls -ldZ /usr
ls -ldZ /usr/lib
ls -ldZ /usr/lib/cgi-bin
ls -lZ /usr/lib/cgi-bin/index.cgi

on each server should show that they are the same or not.

(Omit the Z if it shows errors.)

>  # this, as the rest of the conf, is the same on both

If you "diff conf1 conf2", do you see only and exactly the expected
changes from lines before this point?

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list