Magento 2.12 Varnish 5.0 Error 503 Backend fetch failed **SOLVED** PHP 7.1 Nginx Varnish 5.x

Magento 2.x 503 backend fetch failed varnish

This blog is my diary so I can keep track what I fix and what I’ve learned and today after spending some time and pulling my hair, as we are about to launch our e-commerce site I was able to fix this error – This is a bug which is already reported a few months back. This will work with NGINX – Varnish 4.x or Varnish 5.x

/etc/varnish/default.vcl

Look for

.url = "/pub/health_check.php";

Change the above line to

.url = "/health_check.php";

On NGINX you need to fix the configuration file in my case it’s called nginx.conf.sample which are also inside Magento folder.

Line looks something like this before the modification

# PHP entry point for main application -location ~ (index|get|static|report|404|503)\.php$ {

Make changes to the following:-

# PHP entry point for main application

location ~ (index|get|static|report|404|503|health_check)\.php$ {

It’s a bug which was also reported on Github

Don’t need your donation a simple THANK You comment is more than enough for me.

11 thoughts on “Magento 2.12 Varnish 5.0 Error 503 Backend fetch failed **SOLVED** PHP 7.1 Nginx Varnish 5.x”

  1. I am facing the same issue on 2.3.5-p1 only on home page (domain.com), works fine on other pages e.g. (domain.com/index.php), but this did not help me. Has anyone else face problem like mine?

Leave a Reply

Your email address will not be published. Required fields are marked *