Questions tagged [varnish]

Varnish is a high-performance reverse proxy and load-balancer package for Linux/Unix systems.

Varnish is primarily a caching reverse proxy, but also exhibits load-balancing and backend checking mechanisms and is very widely used on high traffic websites.

Varnish was designed from the ground to be a high performance reverse caching proxy and to not compete with the operating system on managing resources like memory. Most recent versions of Varnish support storing cache on memory or disk, and serving old content in case of backend fail (saint mode), among other features.

Varnish is written by Poul-Henning Kamp (PHK), and his Architect Notes are available about varnish design. PHK is also a well known FreeBSD kernel developer and mantainer.

926 questions
151
votes
13 answers

How to set up Nginx as a caching reverse proxy?

I heard recently that Nginx has added caching to its reverse proxy feature. I looked around but couldn't find much info about it. I want to set up Nginx as a caching reverse proxy in front of Apache/Django: to have Nginx proxy requests for some (but…
Continuation
  • 3,050
  • 5
  • 29
  • 38
54
votes
5 answers

Ordering: 1. nginx 2. varnish 3. haproxy 4. webserver?

I've seen people recommend combining all of these in a flow, but they seem to have lots of overlapping features so I'd like to dig in to why you might want to pass through 3 different programs before hitting your actual web server. nginx: ssl:…
Joel K
  • 5,765
  • 2
  • 29
  • 34
26
votes
2 answers

where can i find varnish log files? /var/log/varnish is empty

I'm trying to read log files of Varnish server in Ubuntu environment. I actually never used Varnish before. so...I cd to /var/log/varnish, but the folder is empty. it tells me that I have to configure my varnish server to save logs...is that true?
Moon
  • 2,033
  • 4
  • 24
  • 23
24
votes
2 answers

Varnish Cache - default TTL?

I have discovered that I can set the TTL in Varnish as follows in my VCL file: sub vcl_fetch { # 1 minute set obj.ttl = 1m; } But what is the default setting (assuming the backend server is setting no cache-control header) ?
Ade
  • 689
  • 3
  • 10
  • 21
22
votes
2 answers

Is Varnish with nginx better than just using nginx?

I see a lot of talk about using nginx with Varnish and I do not understand why. Isn't nginx enough? Nginx has SSI, has reverse proxy cache, is lightweight, has SSL, can work with cgi, fpm, etc. Varnish has the same things, but no ssl, and no cgi…
Bogdan Cosmin
  • 301
  • 1
  • 3
  • 10
21
votes
3 answers

How to check if chosen Varnish cache size is ideal?

I've configured my Varnish cache to use a cache size of 512 MB, using: varnishd ... -s file,/var/cache/varnish.cache,512M Questions: How do I monitor if 512 MB is too small, too big or okay? How do I get the current usage size of the cache? How do…
knorv
  • 1,789
  • 6
  • 19
  • 29
20
votes
5 answers

Prevent port change on redirect in nginx

I currently have nginx setup to serve content through Varnish. Nginx listens on port 8000 and varnish connects users' requests from 80 to 8000. The problem is, on some occasions, particularly when trying to hit a directory, like site.com/2010, nginx…
arbales
  • 497
  • 1
  • 4
  • 16
18
votes
4 answers

Best practice for proxying package repositories

I have a collection of CentOS servers in my corporate network. For security reasons, most servers do not have general outbound internet access unless it is a core functional requirement for the server. This creates a challenge when I need to update…
Dave Smith
  • 181
  • 1
  • 4
15
votes
1 answer

The strange case of Mr. Time To First Byte

I've got a webserver on a Linode 1024 VPS based on Ubuntu 11.10 Nginx 1.0.5 PHP 5.3.6 (with PHP-FPM, APC) Varnish 3.0.2 And a couple of blogs there based on WordPress 3.3.1. One of them is a plain blog, with the default config, theme and just the…
javipas
  • 1,292
  • 3
  • 23
  • 38
14
votes
2 answers

Main differences between SSI (Server Side Include) and ESI (Edge Side include)

I need to include dynamic content into static pages at web server level. The 2 options I have found so far are Server Side Include (SSI) and Edge Side Include (ESI). While the origins of SSI seem old and obscure (that cached page from 95 from…
Max
  • 3,373
  • 15
  • 51
  • 71
14
votes
2 answers

Custom 503 Error Page With Varnish

How can I tell Varnish to show a custom html error page instead of the default "Guru Meditation" message?
Christian Davén
  • 391
  • 1
  • 4
  • 13
13
votes
4 answers

Nginx Varnish Nginx Django?

I have a django app and I want to to setup Varnish on a server in front of it. In another serverfault thread somebody suggested putting Nginx in front of Varnish. Should I put Nginx in front of Varnish on the caching server? If so, should I use…
Enrico
  • 491
  • 1
  • 6
  • 15
13
votes
2 answers

Purge varnish cache for a single url using varnishadm

Varnish is being used in a Wordpress website. I would like to purge Varnish for a single URL instead of a whole domain. With this command I can restart Varnish for the whole domain: varnishadm -T :6082 -S /etc/varnish/secret 'ban req.http.host ~…
rfc1484
  • 201
  • 2
  • 3
  • 7
13
votes
2 answers

Varnish versus other reverse proxies

I'm working with an organisation that has deployed Varnish as a caching reverse proxy for all of their web traffic. Their traffic make up is a lot of customer-generated dynamic websites, with the usual collection of static assets hanging off the…
womble
  • 95,029
  • 29
  • 173
  • 228
11
votes
2 answers

varnish daemon not listening on configured port

I'm trying to install varnish on ubuntu 16.04, I read several article none are working. From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd). Now on I've got a real mess wich don't work :…
Bruno
  • 213
  • 1
  • 2
  • 7
1
2 3
61 62