post Category: Code, Internet — Chris @ 3:48 pm — post

Recently, quite a few people have mailed me asking how I perform session persistence correctly across the different webservers I run. It’s a good question, and one which i’m pleased to answer. My webservers host many different resources, not just a blog. Not all these services are hosted on both boxes. So, here’s how I quickly spread the different services.

$path = http.getpath();
#log.info( "Path: ".$path );
$host = http.getHostHeader();

#  Send these client requests to a pool of nodes that uses cookies
# for Session Persistence

        if( string.contains( $path, "gallery" ) ||
            string.contains( $path, "postfixadmin" ) )
            { pool.use( "Sticky Pool" );
# All other clients, if they need re-directing to a specific node, 
# we do it here.
    } else if( string.contains( $path, "ids" ) ||
        string.contains( $path, "awstat" )     ||
        string.contains( $path, "mailscanner" )||
        string.contains( $host, "rt" )         ||
        string.contains( $host, "webmail" )    ||
        string.endswith( $path, "cgi" )        ||
        string.contains( $path, "~" ) )
            { connection.setPersistenceNode ( "192.168.4.3:8081" );
            }

Yes, it really is -that- simple.

Sorry, no comments yet.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.
 

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 4 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a