Forum Discussion
Brent_Sachnoff_
Nimbostratus
Dec 13, 2006Serverside redirects
Our network setup consists of a F5 and 3 web servers all in the same pool. We terminate SSL on the F5 which means we are just doing http on the serverside. We recently started to do server side redirects which forces the redirect to hit the pool again and goto another server. This causes all kinds of issues due to the various cookies that our app is looking for and can not longer find because when they hit the new server, it looks like a new session.
I was looking at doing something with HTTP_RESPONSE and comparing the uri being generated on the serverside with our problem uri. If it matches I would send it back to the same server. It seems I can not use HTTP::uri with HTTP_RESPONSE.
What is everyone else doing in this scenario? Any iRule snippets out there that might give me some more direction?
- Deb_Allen_18Historic F5 AccountThe server-generated redirect URI is contained in a server response header, so rather than using [HTTP::uri], you can use [HTTP::header] to catch and manipulate the Location: header within the HTTP_RESPONSE event:
when HTTP_RESPONSE { if { [HTTP::header exists Location] }{ set myNewRedirect HTTP::header replace Location $myNewRedirect } }
However, you might want to experiment with a persistence profile instead of an iRule to solve the problem. Persistence is easy to implement. Cookie persistence is low overhead, and would work if redirects are to the same server name. HTH /deb
- Brent_Sachnoff_
Nimbostratus
Thanks for the quick response Deb. - Deb_Allen_18Historic F5 AccountIf the hostname is the same for both HTTP and the subsequent redirect to HTTPS, the browser should submit the cookie when following the redirect.
- Brent_Sachnoff_
Nimbostratus
The Redirect rewrite is exactly what I am looking for! Thanks a lot!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects