10060: A connection attempt failed

  • | 462 points


    From time to time, usually it happens once or twice a day where my local websites stop loading and I have to reload Nginx in order for it to work again.

    I receive 504 Gateway Time-out in the browser and looking at error.log it shows the following error message:

    2017/02/15 17:17:32 [error] 10740#9232: *4467 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client:, server: manager.dev, request: "GET /site/list/2/2/edit HTTP/1.1", upstream: "fastcgi://", host: "manager.dev", referrer: "http://localhost:3000/site/list/2/2/edit"

    I tried searching this forum and Google without much luck :frowning2:

    My setup is:

    • Windows 10
    • Laragon Full 2.1.6
    • Nginx 1.10.1
    • PHP 7.1.1
    • MariaDB 10.2.3

    It's not a huge deal but if anyone has a solution, it's highly appreciated.

  • administrators
    | 131225 points

    @SaeedPrez :
    You can try increase the number of PHP Upstream Processes.
    Here's how:

    1. Open user\laragon.ini (Menu > Laragon > Settings file: laragon.ini)
    2. Put Upstream=X under [nginx] section

    Laragon will auto manage 5 PHP processes to handle requests.
    Hope it help.

  • | 462 points

    Thank you @leokhoa, I will try it today and get back with the results.

  • | 462 points


    The problem still exists, just happened again. I should add that when it happens, I can not load any further pages until I reload the Nginx server.

    Even other domains stop working, it just sits and thinks until it times out.

  • administrators
    | 131225 points

    Strange. You may try to switch to a PHP Non Thread Safe version:

  • | 462 points

    @leokhoa Tried PHP 7.1.2 Non Thread Safe but the problem persists. I'm not sure, but it might have something to do with BrowserSync and viewing the page simultaneously on multiple devices..

    It just crashed again so I'm going to try with Upsteam=10 and see if that helps.

  • administrators
    | 131225 points

    @SaeedPrez: That's the cause. I hope increase Upstream to enough number can help.

  • | 20 points

    Same for me.. I tried all the above settings.. but unfortunately it's the same..

  • | 289 points

    Happens to me too. Anyone got a solution for this?

  • administrators
    | 131225 points

    @Christhofernatalius : This topic is old and seldom people have the issue. Any images?

  • | 289 points

    @leokhoa this usually happens when I do many requests within short time. Like over hundreds requests within one minute or so. Then all requests will just timeout. And problem solved after reloading nginx. IIRC this doesn't happen with apache, so I'm back to using apache.

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.