502 errors with nginx and php5-fpm

Maxim Dounin mdounin at mdounin.ru
Mon Sep 8 11:50:58 UTC 2014


On Sun, Sep 07, 2014 at 07:15:46PM -0400, nfn wrote:

> Hi,
> I'm getting lots of 502 errors but my nginx logs and php logs don't give me
> information that can help me identify the problem.
> I only have the 502 errors in the access logs. I don't see any errors in the
> error.log or php logs.
> Fist, how can I configure nginx and php so I can get more information about
> the problem?

If the 502 error is returned by nginx, the reason should be logged 
to error log, at the "error" level or higher.

If you don't see anything in your error log, this may mean one of 
the following:

- The error was returned by the backend.  (Highly unlikely in case of 
  php-fpm, AFAIK.)

- You are looking into the wrong log, or your error log is configured 
  to only log errors with higher levels.  See 
  http://nginx.org/r/error_log for details on configuring error 

It is also possible to configure nginx to write debugging logs, 
with all low-level information about request processing, see here:


(This still uses error_log though.)

Maxim Dounin

More information about the nginx mailing list