Connection breakage between cloudflare and the server


hi i have attached image of the error(breakage between cloudflare and the server). this is coming daily for few times and i have talked to my hosting and they are saying nothing is wrong with their servers i dont know how to solve this issue. i dont want my site visitors to see this screen/error at all. it would be great help if some one can help. thank you


This should get yo pointed in the right direction.


Thanks for replying, most of the times the error code is 520 an unknown error accurred.
Some think like that


But i can always see browser working, cliudflare working and server unknown error.

Is there any way to solve this??
Is there any way even if there is an error we can atleast hide this screen?


Supposedly, these pages replace what would otherwise be a browser error (though, if the browser timeout is longer than Cloudflare’s, the site may have finally loaded after a very long time).

Something must appear in the case of error. Those error pages can be customized, but only “if you pay”, based on . How much do you need to pay (what’s the minimum plan), I do not know, as in a quick scan of the plans page I must have missed it (or it’s not written).

Anyway, if you’re on the free plan and plan to stay free, then it’s not possible to get rid of them the way they look (but you could try making your site work more reliably and then never see an error). If you are already on a paid plan, you could try following the instructions in the first link, and if your pay level allows for this, it should work.


Slightly off-topic but I found small issue with your http -> https redirect. Your domain redirects to with a 404.


thank you so much for letting me know about it. i will check it and solve this. Really appreciated. thanks again


i am on free plan and will continue with the same. as per my hosting nothing is wrong with there servers. i am unable to find the reason of the issue


can you check if these settings are correct

Header set Content-Security-Policy: upgrade-insecure-requests

RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

ExpiresByType image/jpg “access plus 60 days”
ExpiresByType image/png “access plus 60 days”
ExpiresByType image/gif “access plus 60 days”
ExpiresByType image/jpeg “access plus 60 days”

ExpiresByType text/css “access plus 2 weeks”
ExpiresByType image/x-icon “access plus 2 weeks”

ExpiresByType application/pdf “access plus 1 month”
ExpiresByType audio/x-wav “access plus 1 month”
ExpiresByType audio/mpeg “access plus 1 month”
ExpiresByType video/mpeg “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/quicktime “access plus 1 month”
ExpiresByType video/x-ms-wmv “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”

ExpiresByType text/javascript “access plus 2 weeks”
ExpiresByType application/x-javascript “access plus 2 weeks”
ExpiresByType application/javascript “access plus 2 weeks”

RewriteCond %{HTTP_REFERER} !^ [NC] RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{HTTP_REFERER} !^
[NC] RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{HTTP_REFERER} !^ [NC] RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{HTTP_REFERER} !^
[NC] RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteRule .*.(jpg|jpeg|gif|png|bmp)$ - [F,NC]


I don’t use Apache so this might not be correct but I think you only need one rewrite instead of the bottom 4

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

There might be a better solution here:

You can also let Cloudflare do the http to https redirect:

  • Crypto -> Always Use HTTPS


is this correct now?

RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

closed #12

This topic was automatically closed after 30 days. New replies are no longer allowed.