iredir

A squid redirector written in python

A squid redirector i required to build up a couple of customer sites. It has grown and is now even used on plone.org.

What is It?

  • iredir is a small python program which can be used as a squid redirector to rewrite urls based on definitions.
  • These definitions are configured in a python file which is reloaded any x requests. To have python as configuration language for the redirector, nearly everything can be done very easily.
  • iredir is largely based on the pyredir redirector. http://freshmeat.net/projects/pyredir/
  • Several large profile websites use iredir now to integrate squid with zeo.
  • Among them are most of the high profile icoya customer websites i set up for my employer strukturAG and, for example plone.org.
  • iredir supports squid2 and squid3, including multithreaded redirectors introduced with squid3.

How to use it?

Take a look at the howto section (http://longsleep.org/howto/squidwithzopeandesi). Also look at the general squid redirector docs at http://www.squid-cache.org/Doc/FAQ/FAQ-15.html. To configure iredir, load the file 'redirector_class.py' into your favorite text editor and look at the manual at the start. Change this file to configure the redirector to your needs. You are free to write any kind of python code there.

Common mappings look like:

Squid load balancing with ZEO as parent caches:
(10, '[\S]*mycompany.com'): 'backendpool/VirtualHostBase/http/$netloc$:80/mycompanyportal/VirtualHostRoot',

Usual rewrite to one http backend:
(20, '[\S]*mydomain.com'):  '127.0.0.1:9065',

Redirect to another domain:
(30, '[\S]*myolddomain.(com|net|org)'): '302:www.mydomain.com',

Download

File iredir Release 1.5 (stable)
File created on Fri 15. Jun 2007 07:33 by Useradmin

File iredir Release 1.3 (Stable)
File created on Fri 06. Aug 2004 10:46 by Userlongsleep

File iredir Release 1.2 (Stable)
File created on Fri 04. Jun 2004 15:10 by Userlongsleep


Copyright Simon Eisenmann http://longsleep.org/ - License under Creative Commons License - valid: xhtml, css

powered by icoya