Varnish as a redirector for a millions URLs

Rangel, Raul Raul.Rangel at
Thu May 23 15:57:56 CEST 2013

Can you make a backend that takes a url, looks it up in the database and returns a 301? You could then cache the 301 in varnish. Thought tht will only work for GETs. Once you get into POST requests it's another story.


From: varnish-dev-bounces at [mailto:varnish-dev-bounces at] On Behalf Of Aleem B
Sent: Thursday, May 23, 2013 7:41 AM
To: Poul-Henning Kamp
Cc: varnish-dev at
Subject: Re: Varnish as a redirector for a millions URLs

It's based on a DB lookup. Currently I am using NGINX + Redis and there are about a million URLs.


On Thu, May 23, 2013 at 6:37 PM, Poul-Henning Kamp <phk at<mailto:phk at>> wrote:
In message <CA+=Uhp_pepXsb6Q_ORQpYe+AhWSh_yytRNjKBzBBA_FxwJb28Q at<mailto:Uhp_pepXsb6Q_ORQpYe%2BAhWSh_yytRNjKBzBBA_FxwJb28Q at>>

>I currently use nginx + redis + lua module to setup redirects for close to
>a million old URLs that have been ported to a new platform.
Are the redirects based on rules ?

Ie, something like:

        /article?ID=#####  -> /#####

or is it a database lookup to figure out the mapping ?

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG<mailto:phk at FreeBSD.ORG>         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-dev mailing list