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

URL: https://sohaib.com/blog/magento-2-12-varnish-error-503-backend-fetch-failed-solved-php-7-1-nginx-varnish-5-x
Author: Sohaib Khan
Published: Jan 27, 2018
Updated: Sep 8, 2026
Category: E-commerce Solutions

> 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…

**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

```plaintext
/etc/varnish/default.vcl
```

Look for

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

Change the above line to

```plaintext
.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

```plaintext
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.
