• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Nginx/PHP-fpm/fastcgi error: "upstream prematurely closed connection"

Coop1979

Well-known member
#1
I've been testing my XenForo migration on a new server and after over a month of use, yesterday I starting getting 504 and now 502 errors on any php page I try to access. I looked in the Nginx logs and it shows the following errors:

Code:
2012/04/24 10:37:23 [error] 554#0: *15 upstream prematurely closed connection while reading response header from upstream, client: 00.000.00.000, server: testxenforo.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "testxenforo.com"
I was getting 504 errors and changed my backlog size within php-fpm.conf to "-1" per this tip: http://serverfault.com/questions/17...-out-error-with-almost-zero-load-on-a-test-se

But now 502 errors persist and I am getting the error shown above.

Does anyone have any ideas or have a server admin reference who I could hire to take a look?

This is all a bit odd since there is pretty much just me using the server right now.
 

Adam Howard

Well-known member
#2
Are you using Nginx as a proxy to anything?

Code:
-proxy_pass http://node/;
    +proxy_pass http://node;
This could resolve it if you are.

You may want to check your LOGS clearly (carefully). Client: 00.000.00.000 Your IP shouldn't be all ZERO.

If it was all working flawless before... 1 of 3 things has happen.

1) You changed a setting
2) You upgraded which changed a setting
3) You've been hacked.

The all zero IP gives that away.
 

Coop1979

Well-known member
#3
Nope, not using Nginx as a proxy to anything.

I changed the ip address to all 0s for privacy reasons. I know that #1 and #2 aren't true, because Sunday night everything was fine and then Monday morning errors started popping up in the logs and I couldn't access the site.

PC me if you are available for some consulting to take a look at it.