cancel
Showing results for 
Search instead for 
Did you mean: 

Apache + SSL + Varnish

Apache + SSL + Varnish

Hi,

Did anyone have successfully set up this configuration. I try by reading a few articles but with no luck.

 

Magento 2.2.0

Server version: Apache/2.4.39 (cPanel)

varnish-4.1.11

 

If anyone has working configuration please share some knowledge and advice. Thanks 

2 REPLIES 2

Re: Apache + SSL + Varnish

Magento should work fine with the setup you stated.

What issues are you facing?

Re: Apache + SSL + Varnish

Hi,

First sorry for late replay but I've been busy with some other things on the site.

 

So this is my config: varnish default.vcl

vcl 4.0;

import std;

backend default {
.host = "199.192.25.137";
.port = "80";
.first_byte_timeout = 600s;
.probe = {
.url = "/pub/health_check.php";
.timeout = 2s;
.interval = 5s;
.window = 10;
.threshold = 5;
}
}

 

varnish.params

VARNISH_LISTEN_ADDRESS=199.192.25.137
VARNISH_LISTEN_PORT=8080

 

httpd.conf 

<VirtualHost 199.192.25.137:443>
ServerName dev.zenithsecurityco.co.uk
ServerAlias www.dev.zenithsecurityco.co.uk
DocumentRoot /home/londtser/dev.zenithsecurityco
ServerAdmin webmaster@dev.zenithsecurityco.co.uk

RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}
ProxyPass / http://199.192.25.137:8080/
ProxyPassReverse / http://199.192.25.137:8080/

</IfModule>

 

Result:

< HTTP/1.1 503 Backend fetch failed
< Date: Tue, 17 Sep 2019 14:46:02 GMT
< Server: Apache
< Content-Type: text/html; charset=utf-8
< Retry-After: 5
< Content-Length: 278
< Connection: close
<
{ [data not shown]
100 278 100 278 0 0 1082 0 --:--:-- --:--:-- --:--:-- 1085
* Closing connection 0
<!DOCTYPE html>
<html>
<head>
<title>503 Backend fetch failed</title>
</head>
<body>
<h1>Error 503 Backend fetch failed</h1>
<p>Backend fetch failed</p>
<h3>Guru Meditation:</h3>
<p>XID: 3</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>

 

I can't set Apache to listen to 8080 so I turn things. Apache listen at 80 and Varnish at 8080, proxy to :8080