Forum Discussion
Eireann78_19953
Nimbostratus
Sep 16, 2008Http to Https from HTTP_RESPONSE
Hi,
I am having an issue where I re-direct traffic to a VIP and use a class profile to change this to https.
This works fine but unfortunately the app then responds using http so to save...
hoolio
Cirrostratus
Sep 16, 2008Hi darraghk,
The concept of the rule snippet you listed wouldn't work as the HTTP::host and HTTP::uri commands won't return values in in the serverside context (like HTTP_RESPONSE). And if it did, you'd be redirecting the client to https for the same host and URI they just requested, not where the application is directing them for the next request.
Does the app send references to https in the Location header of redirects or within the payload? If it's in redirects, you should be able to use the rewrite redirects option on the HTTP profile. Or if you need to add more logic than the default config options you could use an iRule that looks for HTTP::is_redirect and checks/modifies the Location header. If it's references to https in the response payload, you could use a stream profile and iRule to modify it.
For more info on the HTTP profile option for rewriting redirects, try searching askF5.com for 'rewrite redirects'. For info on using an iRule to rewrite redirects, check the iRule Codeshare. And for examples of using a stream profile to rewrite response content, check the iRule wiki page for STREAM::expression.
Aaron
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