Cloudflare-nginx


#1

Hi there

I have problems with Google Search - all my websites from the webpages are not shown in Google Search.
From Google Search Support I got this message:

"Hi Carina Kock,

In the screenshot from Fetch As Google click on the arrows to the right and compare what Google sees with what it should say.

The non-www URL should 301 redirect to the www URL. Currently it returns a 406.

Because the server appears to be cloudflare-nginx you may want to ask Cloudflare if they are experiencing issues.

curl -i http://spisdigrask.dk/
HTTP/1.1 406 Not Acceptable
Date: Tue, 30 May 2017 20:55:05 GMT
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=…; expires=Wed, 30-May-18 20:55:05 GMT; path=/; domain=.spisdigrask.dk; HttpOnly
Server: cloudflare-nginx"

I don’t know anything about this - can anyone help me with this issue?

Best regards
Carina


#2

Hello
@carina
I think you need to configure CloudFlare correctly with WP Rocket Cache plugin. At the moment, your site is not loading correctly at my end. It returns lots of 404 and 503 errors.

Have a look
http://docs.wp-rocket.me/article/18-using-wp-rocket-with-cloudflare


#3

Website running slow/ not showing correctly here too! Check Apache Log to dig further into the 406 errors, Have you setup any firewall rules in cloudflare? But check out the website @GulshanKumar suggested to setup WP Rocket correctly.


#4

Hi GulshanKumar

Thanks for your reply. Actually it seem that CloudFlare is correctly configured. I have just looked at it again and all the settings are correct. Do you possibly have any other ideas to my issue ?


#5

@carina did you have a look at apache logs or have you setup any firewall rules in cloudflare?


#6

Hi danstock

Thanks for replying. I haven’t made any firewall rules in CloudFlare.
I don’t know anything about Apache Log - yet. Will take a look at this … it’s rather difficult for me. Not easy to understand.


#7

@carina I will try help as best as i can, if you have access to the logs then try look here

A typical location for all log files is /var/log and subdirectories. Try /var/log/apache/error.log or /var/log/apache2/error.log


#8

There are multiple issues. let me explain you one by one.

####CSS are returning 503

###JS are returning 404.

Sol: At the official docs, it is recommended to keep Cache Lifespan 0 to fix this problem.
http://docs.wp-rocket.me/article/138-my-site-has-no-styles-and-looks-broken

I would recommend, please clear/flush/purge cache to fix this issue.


#9

You know the interesting thing is, this problem is not happening all pages, but only on few page. Once you would fix cache issue, this issue should be fixed easily. From my side, I would say, please clear cache.

Wp Rocket team is very kind. They would love to assist regarding this matter. I would encourage to ask them specifically to learn more and to prevent this issue in future. As this problem directly impacts user experience of your site.


#10

Hi danstock
If I do find the log, I’m not able to understand what I should do. Sry, I’m new in this world…


#11

Hi GulshanKumar
Thanks for your explanation, and as you have suggested, I have done as you told on Cache Lifespan (set to 0). Also clear/flush/purge cache and it is still the same mess. Do you by any chance have other ideas to my problems…?


#12

Based on my experience with WP Rocket, I can say please try any alternative. It may work properly.
I am no more using WP Rocket due to similar issues, I shifted to W3TC and I am not facing any such problem.


#13

Thank you, I will consider your proposal.


#14

I don’t do much with WordPress these days, but I would second the switch to W3TC and possibly add Autoptimize as well. I was using these in tandem with great success (though after a bit of tweaking). IIRC I disabled minification on the Cloudflare side and in W3TC and used Autoptimize for the css/js concatenation/minification. It can also aggregate inline css/js, which it appears you have a decent amount of (some render-blocking as well).

It may be helpful to know how many plugins you’ve got running on this WP installation, as some tend to bog things down…

I ran some speed tests on the main URL and at first the results were quite poor (load times mainly), but now I see they are improving in just the last few minutes - not sure what happened but :sunglasses:


#15

W3TC is so dated especially if you use Nginx web server. Check out better updated version of WP Super Cache created by KeyCDN folks called Cache Enabler https://en-au.wordpress.org/plugins/cache-enabler/ paired with AutoOptimise is good.


#16

Ah yes, W3TC relies heavily on modifying Apache’s .htaccess which of course is moot when you’re running nginx. I should spin up a WP instance on nginx and see what the current cache offerings are like, (I much prefer nginx save for a few specific scenarios).