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.

asked May 3, 2018 at 15:01
5
  • please run varnish log and see the error Commented May 4, 2018 at 6:53
  • logs now in the question Commented May 4, 2018 at 11:20
  • is varnish now working on your website? Commented May 4, 2018 at 12:02
  • we are still getting 503 errors, i have had to disable the apache proxypass to varnish to focus on other things Commented May 4, 2018 at 13:15
  • @IanRichens can you help me configuring my Varnish installation, Magento 2.4, Varnish, Apache reverse proxy? Thanks in advance!! Commented Apr 22, 2021 at 5:02

1 Answer 1

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.

answered May 4, 2018 at 15:35
1
  • these days better config is - hitch - varnish - apache Commented May 4, 2018 at 20:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.