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
  • I also see no activity in the varnishlog with curl -v https – Markus Jul 12 '18 at 16:08

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.

| improve this answer | |
  • Thanks Kuba for looking at this, I thought it would go through varnish due to the default config of /etc/varnish/default.vcl with backend default {.host = "";.port = "8080";} – Markus Jul 13 '18 at 7:56
  • I changed ProxyPass to :80 and indeed it's appearing in varnishlog but I see no speed improvement and doubt the caching is working. I noticed each time i reload a test.php it's also appearing in the appache access.log each time, which doesn't occur going through http where the page only get's served by varnish. – Markus Jul 13 '18 at 8:00
  • @Markus Well that's a different question, but I think it's too broad to be valid on this site. – kubanczyk Jul 15 '18 at 10:57

You have two options https://bash-prompt.net/guides/apache-varnish/ or use nignx as a proxy to handle https requests https://www.smashingmagazine.com/2015/09/https-everywhere-with-nginx-varnish-apache/

| improve this answer | |

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.