Questions tagged [varnish-vcl]

The Varnish Configuration Language (VCL) is a small domain-specific language used to define request handling and caching policies for the Varnish HTTP accelerator. Do not confuse this with the Visual Component Library (VCL) used in Delphi and C++Builder. Use the "vcl" tag for questions related to those products.

The VCL language is a small domain-specific language designed to be used to define request handling and document caching policies for the Varnish HTTP accelerator. When a new configuration is loaded, the varnishd management process translates the VCL code to C and compiles it to a shared object which is then dynamically linked into the server process.

The VCL documentation can be found on the documentation site.

677 questions
0
votes
1 answer

How do I reconstruct the request cookie in varnish vcl?

I am not sure if I am asking the right question. I have varnish sitting infront of a site that have access to numerous cookies. The most important are creds cookie. What I am doing is stripping all the cookies that I do not need and then check if…
awm
  • 1,130
  • 3
  • 17
  • 37
0
votes
1 answer

Varnish VCL in Eclipse

Is there any Eclipse plugin to do syntax highlighting and autocomplete for Varnish VCL? I know that you can use vim and there is a syntax file for VCL, so please do not recommend this.
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
0
votes
1 answer

domain.com to www.domain.com rewrite in Varnish

I need to rewrite domain.com to www.domain.com using varnish. I have already done that for Nginx. But no Idea how to do in varnish. Let me explain why I want to do that, if my approach is wrong then please correct me. Whenever I hit the site with…
SAM
  • 641
  • 2
  • 16
  • 30
0
votes
1 answer

Varnish seems to be doing gunzip a lot

I would like your help to clarify this n_gunzip on my varnish setup. These are my stats for one server that is running a couple of websites. 34837 0.00 0.50 cache_hit - Cache hits 1022 0.00 0.01 cache_hitpass -…
ddutra
  • 1,459
  • 1
  • 14
  • 17
0
votes
1 answer

How to ignore spree redirects in varnish?

I am using varnish on a RoR application. I am getting a redirect loop on the "forgot password" link. I suspect that this is happening due to spree gem (backend). How can I ignore redirects from spree in varnish? Following is my vcl: # This is a…
nish
  • 6,952
  • 18
  • 74
  • 128
0
votes
0 answers

Replacing Apache2 for Varnish as reverse proxy

I'm having some troubles replacing a Apache2 reverse proxy rule for a Varnish ACL. The apache rule is: ProxyPass http://192.168.0.123/OtherSite My Varnish ACL: if (req.url ~ "^/(?i)MySite") { set…
Renato Todorov
  • 560
  • 3
  • 15
0
votes
3 answers

Varnish Error: vcl.load /etc/varnish/default.vcl failed

On executing the command sudo service varnish reload I;m getting the following error: nish@styx:~$ sudo service varnish reload * Reloading HTTP accelerator varnishd Connection failed (localhost:1234) Error: vcl.load…
nish
  • 6,952
  • 18
  • 74
  • 128
0
votes
1 answer

Varnish round-robin load balancing with Named Vhosts

Actually my set up looks like this. cluster.com - 192.168.0.200 (varnish/port 80) example.com - 192.168.0.100 (apache,namebased vhost/8080 - backendname - website) yyy.com - 192.168.0.100 (apache,namebased vhost/8080 -backendname -…
Tharanga Abeyseela
  • 3,255
  • 4
  • 33
  • 45
0
votes
1 answer

Varnish removes PHPSESSID when unsetting cookie

I'm trying, since a long time, to put a working varnish (3.0.4) in front of some of my websites. I started from a clean config file (the one provided with varnish, "/usr/share/doc/varnish/examples/default.vcl.gz"). Well, it's working, but it don't…
Patator
  • 164
  • 1
  • 9
0
votes
2 answers

Varnish say backend busy conn too many

Currently, we configured varnish using turpentine extension for magento. Our configuration is magento + nginx + varnish + php5-fpm + redis. Varnish seems to be behaving odd with our backend nginx. Can anyone help trace why we have problem? We tried…
Jayneel Patel
  • 11
  • 1
  • 2
0
votes
1 answer

Return a synthetic response then fetch and cache object in Varnish?

I'm wondering if my (possibly strange) use case is possible to implement in Varnish with VCL. My application depends on receiving responses from a cacheable API server with very low latencies (i.e. sub-millisecond if possible). The application is…
dcrosta
  • 26,009
  • 8
  • 71
  • 83
0
votes
1 answer

Varnish always cache when certain cookie is present

I want a rule in my vcl_recv that checks if a certain cookie is present, and if so always serves a cached file (let's call this cookie VARNISH_USE_CACHE) However, I also have a rule that runs after this to check for a session cookie (and if it…
leon.nk
  • 437
  • 2
  • 6
  • 15
0
votes
1 answer

Varnish High DB Connections In High Traffic

We're operating an API that at times comes under very heavy traffic at certain periods. Under normal circumstances using varnishstat we can see 0 backend connections are required. We interpret this as Varnish being able to serve all data from the…
0
votes
1 answer

Basic Varnish Configuration

I'm in the baby step stages of setting up Varnish for the first time and I think I must have some fundamental misunderstanding. For the purpose of testing, I've left /etc/default/varnish in its default config: DAEMON_OPTS="-a :6081 \ -T…
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
0
votes
1 answer

Varnish portable vlc script

In Varnish there are some differences between VCL 2.x and 3.0. Hash generation for example. In Varnish 2.x you'd do req.hash += somevar while in Varnish 3.x you would call hash_data(somevar). Is it possible to write portable Varnish scripts that…
Sander Marechal
  • 22,978
  • 13
  • 65
  • 96