Forum Discussion

Jacob_Harres's avatar
Jacob_Harres
Icon for Nimbostratus rankNimbostratus
May 05, 2006

Non-persistance for select URIs

We have a service that is currently setup behind a Cisco Content switch. The setup that is currently in place applys a persistance cookie to all traffic, except traffic to certain URIs. I am migrating this service from behind our CCS to sit behind our BigIPs and would like to replicate this functionality with an iRule. Here is how I'm approaching it;

I've a pool created for the web servers and I've created a VS with the attached iRule;


when HTTP_REQUEST {
if { [URI::path] contains "/fileupload/file_upload.aspx" } {
pool InterAct-Staging
} else {
persist cookie
pool InterAct-Staging
}
}

What I'm intending this to do is evaluate when a request hits the VS, if part of the URI has the file upload script, it sends the traffic directly to the pool, without persistance. However, if the request does not contain the file upload script, it applies a cookie and then sends it to the pool.

As a noob to iRules, I'm not sure if I'm doing this right, so I'd like some feedback from those of you with more experience. Am I on the right track?

Regards,

Jacob

1 Reply

  • Colin, thank you for the feedback, the link was indeed quite helpful.

    After reading through it, I think the idea of naming a persistance profile instead of just a cookie would be a better appraoch, as it gives me a bit more flexibility. In doing this, would I still need to setup the VS with the persistance profile, or would calling it from the rule take care of the job?

    Regards,

    Jacob

    when HTTP_REQUEST {
    if { [URI::path] contains "/fileupload/file_upload.aspx" } {
    persist none
                    pool InterAct-Staging
    } else {
    persist InterAct-persisance-profile
    pool InterAct-Staging
    }
    }