Archive

Posts Tagged ‘varnish’

varnishadm ban

June 24th, 2015 No comments

When cleaning the cache on varnish 3.0 there is a way to only ban the specific host.

The command is:

Read more…

Categories: Varnish Tags: , , , , , ,

How to get varnish client.ip behind ELB

June 19th, 2015 No comments

How to get varnish client.ip behind ELB

I needed to filter access by IP using varnish acl, but when your varnish is behind a Amazon ELB Load Balancer, by default it doesn’t work, so here is the solution! Tested using Linux Amazon Linux AMI release 2015.03

Read more…

check_varnish_uptime

March 25th, 2014 No comments

Simple script to check if the varnish daemon has been restarted latelly

Here is the code:

Read more…

check_backend.sh

March 25th, 2014 No comments

Another bash script to monitor if there were any failed connections to the backend’s.
It is a simple aproach using the command:
varnishstat -1 -f backend_fail
Then it puts the output on a tmp file and next time it runs it checks if it is still having erros on the backend.

Read more…

varnish check_hitratio

March 25th, 2014 No comments

We need to know if varnish is caching hit ratio is as it should.
So I wrote this simple bash plugin for nagios.

Read more…

Script to purge varnish cache

August 15th, 2013 No comments

There is a easy way to allow developers to stop bugging us the system adminsitror, “clean the cache”.
Just setup this php page on a apache server and they can do it themselves.

Read more…

Categories: Varnish Tags: , ,

varnish dynamic backend

June 14th, 2013 1 comment

Varnish pointing to a Amazon ELB (elastic load balance) does not work.
Error:
Backend host “XXXXXXXXXXX-123456789.us-east-1.elb.amazonaws.com”: resolves to multiple IPv4 addresses.
Only one address is allowed.

Read more…

How varnish can identify mobile users

November 10th, 2011 No comments

How varnish can identify mobile users

In this example it basically finds out via regex on the user-agent tag if the user
is mobile if so it redirect to a mobile site.

Read more…

Categories: HowTo, Varnish Tags: , , , , ,

Varnish security.vcl

July 21st, 2011 3 comments

How to setup Security.vcl on Varnish 3.0

Download it
wget https://github.com/KristianLyng/varnish/tree/my2.1/varnish-tools/security.vcl
# cd vcl/
# make
# cp -a vcl/ /etc/varnish/security.vcl/
(alternatively you could symlink it, of course).
Now all it has to be done is edit your normal VCL and
add this line near the top:
include “/etc/varnish/security.vcl/main.vcl”;

Read more…

How to install varnish

July 20th, 2011 No comments

How to install varnish

This is a step-by-step on howto setup and run varnish web cache.
This was done for Linux RedHat 6 64bits, same works for CentOS 5.5 64bits with varnish 3.0

Read more…