Varnish & Cloudflare causes a 503

Dear,

Our website nikolabrussels.be is unreachable.
Error:

Error 503 Backend fetch failed

Backend fetch failed

Guru Meditation:

XID: 163840491

Varnish cache server


I was told that cloudflare & varnish do not work well together.

What is the best way to solve this?

Because de-activating Varnish doesn’t work either…

Thanks in advance.

That’s an error straight from your server and needs to be fixed there. Cloudflare is not involved here.

Though your domain is not on Cloudflare in the first place.

1 Like

Hey Sandro,

Thank you for answering so quickly.
The website is connected to Cloudflare through the host (vimexx.nl).
What exactly do you mean with ‘your domain is not on cloudflare?’

This is not the case. I have successfully used various combinations of Varnish Cache (Open Source) and Varnish Cache Plus (Paid) with TLS termination using Nginx, Hitch and Varnish In-process TLS.

The 503 is coming directly from Varnish, so that is the place to direct your investigation.

1 Like

The domain is currently not using Cloudflare

nslookup -type=ns nikolabrussels.be a.ns.dns.be
Server:  UnKnown
Address:  194.0.6.1

nikolabrussels.be       nameserver = ns.zxcs.be
nikolabrussels.be       nameserver = ns.zxcs.nl
nikolabrussels.be       nameserver = ns.zxcs.eu

Plus, that error comes from your server in any case. You’ll need to talk to your host about that.

1 Like

Your host seems to have fixed that as it is now loading fine

sitemeer.com/#https://nikolabrussels.be/

I have disabled the varnish and very happy to see that the site is accessible again.

The reason I enabled Varnish is to increase speed front-end and back-end wise.

1: Is adding varnish a good option?
2: Any other tips?

What is the correct way to use cloudflare + varnish?

Can you check if the website is running via cloudflare now?

Thanks in advance

I am afraid questions regarding Varnish are better asked at StackExchange or any other Varnish related forum. But generally speaking there is no issue in the context of Cloudflare.

As for Cloudflare, your domain is not configured for Cloudflare in the first place, hence that won’t work. You first need to complete the setup.

I have few Websites running Varnish, but have seen either a combination where users would have Nginx and over it they would install Varnish (not needed) and over that all put Cloudflare. Therefore they have had some issues regarding the cache settings.

Again, your domain is not using Cloudflare.

Now I understand you.

Please check the website: www.nikolabrussels.be
it should normally be set up through cloudflare.

But I am logged in using a different account, therefore the mix-up?

Nothing has changed in regards to the previous statement.

You need to follow Getting Started with Cloudflare – Cloudflare Help Center for details.

1 Like

Through the backend portal of my host I can activate Varnish.
But besides activating it I can’t do much myself…

As soon as I activate this then we get the 503 so I am not going to do this.

Can you share me tips how to successfully activate varnish without causing any issues with cloudflare/host. ?

Thank you very much in advance

You may be using a Cloudflare plugin, but your site is most definitely not using Cloudflare DNS or Proxy services. I’m about to close this thread, as this not a general server support forum.

I’ve linked the API key to the wordpress plugin and it succeeded.

I’ve also purchased the Automatic Platform Optimization (APO) from cloudflare and it also succeeded.

I’m I now connected through cloudflare?

Did you follow the steps from the mentioned article?

Yes :slight_smile:

How come then your DNS setup is still broken?

The error you’re getting is caused by the fact that Varnish cannot reach your origin server. This means that the original webserver that produces the content could not be reached.

Varnish offers tooling to figure out what caused this. The varnishlog program allows you to access the memory logs that Varnish produces

By running varnishlog -g request -q "ReqUrl eq '/'", you can filter logs for the homepage. The output will be quite verbose, but will contain all the information you need.

A hypothetical log line that might explain what’s going on, is the following:

-   FetchError     backend boot.default: fail errno 111 (Connection refused)

In this case a backend named default in the VCL configuration named boot was not reachable. Your VCL file will contain host and port information about that backend.

In your case, the log output might be completely different. Just remember that varnishlog is your friend here, and that a Error 503 Backend fetch failed is not Varnish that is failing: it’s your origin server that is failing.

6 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.