502 Gateway Timeout on Varnish


  • Hi there,

    I keep on experiencing random 502 gateway timeout when enabling varnish on my domains Sandeep. I tried tweaking everything but I really can't seem to find what's causing this which forces me to just disable varnish completely...

    Error log:
    2020/09/09 00:20:02 [error] 30318#30318: 1742 connect() failed (111: Connection refused) while connecting to upstream, client: 54...219, server: domain.tld, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "http://...*:82/wp-admin/admin-ajax.php", host: "domain.tld", referrer:


  • is apache was running that time?


  • Hi Sandeep! Yes it is running NGINX+Apache+Varnish and Apache is running fine. I've read that it could be caused by php-fpm but I tried using php-cgi but the same thing happens

    I also tried changing from mallaloc to file to test if memory is running out but still happens. This happens on my cwp on centos 7



  • That seems to got it fixed! As usual, you're the best sandeep!

    Also, I saw your referral code to servercheap, do you recommend servercheap for servers that gets around 20,000 visitors or more per month? I heard that servercheap oversells their server and suspends accounts even if they use what they paid for.

    Best regards,

    Wilfred B


  • @will-b they dont suspend untill tos is maintained, and they don't oversell server, if you found any let us know here, I'll let him know.
    They suspend server before that they notices you, when your server is :

    • Infected

    • Ddos

    • Spaming

    • Illegal things

    • High load cpu, breaking cpu fair usage.

    Regarding 20000 k visitors yes they can handle.


  • @sandeep Okay thank you brother! Will try their service once I use up all my credits to my current cloud host

Recent Topics