502 error

Maxim Dounin mdounin at mdounin.ru
Fri Jul 13 20:01:55 UTC 2012


On Fri, Jul 13, 2012 at 12:19:25PM -0400, munkhabi wrote:

> Hello all,
> have question about 502 Bad Gateway error. Does it generated by Nginx,
> or by backend server? If it with in Nginx which module generates it?

The 502 is a generic error which is generated if upstream server 
doesn't respond properly, see here:


It may be generated by nginx (if error happens while talking to a 
backend), as well as by a backend server (if it talks to some 
backends too, and error happens there).

In nginx it's generated by the upstream module, i.e. it might 
happen if you use proxy, fastcgi, scgi, uwsgi or memcached.

Maxim Dounin

More information about the nginx mailing list