I Va(r)nish, did you notice?

| October 28th, 2008

In the never ending geeky roundabouts surrounding my (life &) servers, Ive been looking at many solutions to ease the maintenance and general load. Its all overkill in every meaning of the word when it comes to the sites I run here, but hey, who said it had to make sense now?

In an earlier post I told you how Lighty got replaced with Nginx for the reverse proxy duties. At the time I had Varnish running as a upstream server, which made sense then. But, with the previous paragraph in mind(ease of maintenance), that quickly turned into alot more conf editing than I wanted to spend time on. So, a couple of days ago, I ended up moving around on the pieces(again)..

Varnish -> Nginx(reverse proxy) -> (backend servers) Lighty/Apache/Nginx

Yep, that simple, the backends run various httpd’s depending on the needs/usage. Nginx has become my fav flavour of httpd’s, so it has taken over most of the duties on the backends. It wont take over all servers tho, there is only so much I feel like changing just for the sake of a httpd.

Im currently working on pulling data from varnishstat into Cacti to get some visualization on the hit/miss ratio. They have a script made for Munin that I will adjust for the task, no point in re-inventing the wheel..

Over time, I might “outsource” Varnish to a speedier link, or move it back into upstream duties, but for now, this is where Im at.

The one thing I forgot when I changed was to swap the logformat fields on Nginx(reverse proxy), so I had alot of traffic from a familiar ip today. Ahh well, all good now tho, Webalizer is happy. It does all its work on the reverse proxy, logs split into vhosts/domains.

log_format main ‘$http_x_forwarded_for – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$remote_addr”‘;

The swap in question; http_x_forwarded_for <-> remote_addr