skip to Main Content

I’ve been hemorrhaging hours of research to this and cannot seem to find the right solution, even to understand the problem itself.

The scenario:
I have an multiple ubuntu servers, each server runs an apache hosting multiple sites via apache-vhost. I have a CloudFlare free plan and configures it to only do Flexible SSL/TSL and a Page Rule to force HTTPS access.

The problem:
Some client gets Cloudflare 524 Error while some are just fine.

Tests/Observations:

  1. If I disabled the Page Rule force HTTPS, everything is fine. So this should point on the https problem, but why does the https works on some, and not on the other clients?

  2. http requests are properly logged in the access-log of each vhosted site, I tried it myself, it actually logged my request but I still get Error 524.

  3. The servers are not overloaded but I still get Error 524.

  4. Increased the mpm_prefork settings, still Error 524.

  5. Disallowed any IPs except cloudflare ips via iptables, still Error 524

  6. Disabled multiple vhosted site, still Error 524

I’m currently out of idea on how to understand this problem to solve it. I’ve been exhausing weeks of research but all threads mentioning this specific error doesn’t fit with my case. Help!

2

Answers


  1. you said you enabled force HTTPS with cloudflare.
    Do you even have an SSL certificate on your server? Without this, an https connection is not possible.

    If that’s the case try to run the following commands:

    1. sudo apt-get install certbot python-certbot-apache
    2. certbot --apache -d example.com
    3. Enter you email address

    This should automaticly generate a certificat for your domain.

    Note: when you have subdomains, you have to issue a separate certificate for them!

    Login or Signup to reply.
  2. 524 Error means that cloudflare got a timeout from your server.

    Try looking at your logs for long running pages that might be exceeding the cloudflare timeout threshold (probably 100 seconds).

    What looks like a client problem is really just the nature of random timeouts impacting different clients differently.

    http://windowsbulletin.com/how-to-fix-cloudflare-error-524-a-timeout-occurred/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search