Re: I got 502 and error_log print upstream sent invalid status "0"

60 views
Skip to first unread message

Maxim Dounin

unread,
Mar 29, 2012, 11:27:55 PM3/29/12
to ng...@nginx.org
Hello!

On Thu, Mar 29, 2012 at 11:14:46PM -0400, neoesque wrote:

> Hi everyone,
>
> I have a php-fpm backend. And sometimes I got nginx return 502. After I
> check the error_log I found each 502s are caused by upstream sent
> invalid status "0" while reading response header from upstream
>
> The error_log are in the form "upstream sent invalid status "0" while
> reading response header from upstream client: 127.0.0.1, server: xxxx,
> request: "xxxxx HTTP/1.0", upstream:
> "fastcgi://unix:/dev/shm/api-php.socket:", host: "xxxx", referrer:
> "xxxx""
>
> Does anyone have same experience? I have no idea after search Google
> 'upstream sent invalid status "0"'
>
> I think it is caused by PHP. But why does it sent status '0'?

The message in question means nginx got header line "Status: 0"
from php. Most likely it's what you php code did, not php by
itself.

Maxim Dounin

_______________________________________________
nginx mailing list
ng...@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

neoesque

unread,
Mar 29, 2012, 11:44:24 PM3/29/12
to ng...@nginx.org
Hi, Maxim

Thanks, I'll check those PHP codes.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224638,224642#msg-224642

neoesque

unread,
Mar 29, 2012, 11:56:58 PM3/29/12
to ng...@nginx.org
OH!

You are right, Maxim.

Those errors are retrieving other webpage by using curl. And the
upstreams return status code 0 seldomly.

Thank you.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,224638,224645#msg-224645

Reply all
Reply to author
Forward
0 new messages