Ssl – How to Varnish over https with Apache

Apache2httpssslvarnish

I read few times that nginx is possibly faster and there are other SSL terminators

Varnish and HTTPS with Apache without Ngnix, Pound, HAProxy (can't comment yet)

Anybody successfully setup varnish with Apache?

I found another guide https://bash-prompt.net/guides/apache-varnish/

but unfortunately even though I setup varnish:80 Apache:443 with Proxy to Apache:8080 it's only working for http where curl shows

Via: 1.1 varnish-v4

but https not:

< HTTP/1.1 200 OK
< Date: Thu, 12 Jul 2018 15:21:10 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Strict-Transport-Security: max-age=63072000; includeSubdomains
< X-Content-Type-Options: nosniff
< Strict-Transport-Security: max-age=63072000; includeSubdomains
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding
< Content-Length: 103
< Content-Type: text/html; charset=UTF-8
< Connection: close

Best Answer

Although the guide of your choice has a picture showing that https go through varnish (as well as http), the rest of that section contains nothing that would indicate so. The ProxyPass puts traffic right to Apache localhost:8080 that serves DocumentRoot bypassing Varnish.

You need to ProxyPass to the IP:port that your varnish listens on.