By kaiserhase
So I run three separate Ghost blog/NodeJS websites. I currently use Apache, listening on port 80 and reverse proxy-ing to each specific NodeJS server. All of these rewrite to HTTPS, so no browsing the site with HTTP.
I would like to set up Varnish in front of the Apache server. Now I know it’s not really important to set up Varnish-- I have a no-name website with very little traffic. It’s already convoluted that I have Apache running with NodeJS behind it.
How would I be able to set up Varnish to pipe HTTPS traffic to the Apache server? I saw that Varnish doesnt really handle HTTPS traffic without using nginx. I would rather not have another server running on top of Apache and NodeJS.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There would be absolutely no point in making Varnish just pipe the data to the backend. What most people do is terminate the TLS-connection in Apache2 or Nginx, then proxy that to Varnish, which in turn proxies it to your web server. That way you can cache the data in Varnish.
You can also make Varnish do redirect if the traffic is not going over TLS by looking for X-Forwarded-Proto-headers. Also remember to hash based on the X-Forwarded-Proto-headers, or else you will have a very strange cache, as the objects will look the same to Varnish.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.