We are seeing the following error in our nginx logs. The error is well documented but we have not yet figured out what is causing it. In the meantime, is it possible to display a custom error page when this error occurs? In the same way that we can have error_page directive for http 500 errors.

7252#0: *2711 upstream timed out (110: Connection timed out) while connecting to upstream, client: x.x.x.x, server: domain.com, request: "GET /a_page.php?etc.... HTTP/1.1", upstream: "fastcgi://", host: "thehost.com", referrer: "http://thereferrer.com/"

I don't think the 110 error is actually what is thrown back to the client and is more likely to be a 504 gateway time out. You can define a custom error page and enter corresponding error numbers for it to render in your nginx config. If you already have this in your nginx config, just add in 504.

Site wide:

server {
    listen 80;
    error_page  504  /errorpage.htm;

In regards to the actual problem, it's likely fastcgi is taking too long to return data to nginx. Try increasing the fastcgi_read_timeout in nginx.conf. Otherwise, make sure fastcgi is running properly.

  • 1
    ...better yet, make the php code go faster
    – symcbean
    Apr 18 '13 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.