Nginx + fastCGI = 502 bad gateway

Edho Arief edho at myconan.net
Wed Aug 3 09:02:44 UTC 2011


On Wed, Aug 3, 2011 at 3:51 PM, dekar411 <nginx-forum at nginx.us> wrote:
> Greetings
>
> I'm trying to setup Nagios web interface to work with Nginx, but I'm
> showed a 502 Bad Gateway just after login.
>

according to your netstat output:

> unix  2      [ ACC ]     STREAM     LISTENING     3590     738/fcgiwrap
>      /var/run/fcgiwrap.socket

you should set fastcgi_pass to fcgiwrap socket path (3590 is "I-Node"
column, not listening port):

>
>    location ~ ^/cgi-bin/nagios3($|/.*) {
>        alias /usr/lib/cgi-bin/nagios3$1;
>
-        fastcgi_pass 127.0.0.1:49233;
+        fastcgi_pass unix:/var/run/fcgiwrap.socket;



More information about the nginx mailing list