Connection breakage between cloudflare and the server


#1

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


#2

This should get yo pointed in the right direction.


#3

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


#4

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?


#5

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 https://support.cloudflare.com/hc/en-us/articles/200172706-How-do-I-customize-Cloudflare-error-pages- . 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.


#6

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


#7

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


#8

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


#9

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} !^http://pakbreed.com/. [NC] RewriteCond %{HTTP_REFERER} !^http://pakbreed.com [NC]
RewriteCond %{HTTP_REFERER} !^http://www.pakbreed.com/.
[NC] RewriteCond %{HTTP_REFERER} !^http://www.pakbreed.com [NC]
RewriteCond %{HTTP_REFERER} !^https://pakbreed.com/. [NC] RewriteCond %{HTTP_REFERER} !^https://pakbreed.com [NC]
RewriteCond %{HTTP_REFERER} !^https://www.pakbreed.com/.
[NC] RewriteCond %{HTTP_REFERER} !^https://www.pakbreed.com [NC]
RewriteRule .*.(jpg|jpeg|gif|png|bmp)$ - [F,NC]


#10

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} ^pakbreed.com [NC]
RewriteRule ^(.*)$ https://www.pakbreed.com/$1 [L,R=301]

There might be a better solution here: https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www

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

  • Crypto -> Always Use HTTPS

#11

is this correct now?

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

RewriteCond %{HTTP_HOST} ^pakbreed.com [NC]
RewriteRule ^(.*)$ https://www.pakbreed.com/$1 [L,R=301]


closed #12

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