Author Topic: Error 503 Backend fetch failed  (Read 3079 times)

0 Members and 1 Guest are viewing this topic.

Error 503 Backend fetch failed
« on: March 05, 2017, 05:21:41 PM »
Hi Folks,

I have CentOS 7 with CWP7 at my home server.
So my web server configuration fails, when I try Apache & Varnish Cache & Nginx Reverse Proxy.

tcp        0      0    *               LISTEN      19534/varnishd     
tcp        0      0*               LISTEN      19517/nginx: master
tcp        0      0*               LISTEN      19533/varnishd     
tcp6       0      0 :::80                   :::*                    LISTEN      19534/varnishd     
tcp6       0      0 :::8181                 :::*                    LISTEN      13822/httpd         

This is ok. Before I haven't saw any Nginx port also.

But the server is behind a router.
CWP Settings > Edit Settings:
Activate NAT-ed Mod: with local ip

I get Error 503 Backend fetch failed when I try to load any of websites.

[root@hsrv ~]# curl -I localhost
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Sun, 05 Mar 2017 17:13:23 GMT
Content-Type: text/html
Vary: Accept-Encoding
Last-Modified: Tue, 24 Jan 2017 21:00:51 GMT
ETag: W/"13cd-546dd693ee6c0"
X-Cache: HIT from Backend
X-Varnish: 98344
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive

Also varnish and nginx is here.
The problem comes with Apache I think.
Before a year I fix the same problem by changing IP in apache vhosts template, bud didn't remember.

Can somebody advise?


Re: Error 503 Backend fetch failed
« Reply #1 on: March 05, 2017, 06:01:18 PM »
PS: I'm not sure if this is accurate. Just my opinion.

Even though the webserver is behind a Router; the Router has to accept the Incoming TCP Ports in able to Function Properly; even being Nat'd it has to listen to the incoming IP and TCP in order to function properly; as far as I know.. Firewalls block ports and IP's if they are not Whitelisted.

Re: Error 503 Backend fetch failed
« Reply #2 on: March 06, 2017, 10:18:49 AM »

I fix the issue by changing the IP from public to local address in /etc/varnish/backends.vcl:

#backend cwp1921681220 { .host = ""; .port = "82";}
backend cwp1921681220 { .host = ""; .port = "82";}

And it works! :)

Re: Error 503 Backend fetch failed
« Reply #3 on: May 15, 2017, 12:03:08 AM »
I did the same process change my ip to local and result.

No problem using this local ip insted of public ip?

This is the best solution for that case?
Best Regards