1

magento 2 install on a centos 7 server. with a LAMP stack (php 7)

we have installed magento 2.2.3 with the virtual hosts only using SSL through port 443 and have now come to installing and configuring varnish

varnish 5 installed, varnish configuration exported from the backend of magento and listening on port 80, apache listening internally on port 8080.

now if i try and set apache up to act as the SSL termination by listening on port 443 and forward this to varnish on 80 by adding

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/

to our ssl.conf we get a 503 Backend Fetch Failed error

after searching around, i found the magento devdocs troubleshooting, and have already increased the

http_resp_hdr_len

and the

http_resp_size

but i still get the 503 error.

I have seen people suggesting that the /pub/health_check.php is located/listed wrong in the varnish.vcl that magento generates but this seems to have been patched in 2.2.2

i have also seen people suggest downgrading php to 5.6 but that seems pretty extreme.

does anyone have a solution for this?

EDIT:

this has been resolved, it was a combination of the /pub/health_check.php issue seen elsewhere, missing virtualhosts as a result of the server being locked to only port 443 for security (we made a new vhost for port 80 for varnish, and for port 8080 for apache's backend listen port) AND the DocumentRoot line not being required in the virtualhosts file for the SSL connections (but IS required in the vhosts for port 80 and 8080)

hope this helps anyone else with our issue to resolve it, the site is flying now.

  • please run varnish log and see the error – MagenX May 4 '18 at 6:53
  • logs now in the question – Ian Richens May 4 '18 at 11:20
  • is varnish now working on your website? – MagenX May 4 '18 at 12:02
  • we are still getting 503 errors, i have had to disable the apache proxypass to varnish to focus on other things – Ian Richens May 4 '18 at 13:15
1

this has been resolved, it was a combination of the /pub/health_check.php issue seen elsewhere, missing virtualhosts as a result of the server being locked to only port 443 for security (we made a new vhost for port 80 for varnish, and for port 8080 for apache's backend listen port) AND the DocumentRoot line not being required in the virtualhosts file for the SSL connections (but IS required in the vhosts for port 80 and 8080)

hope this helps anyone else with our issue to resolve it, the site is flying now.

  • these days better config is - hitch - varnish - apache – MagenX May 4 '18 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.