Forum Discussion
https to http force iRule worked on 9.4.6 doesn'twork at 11.4
Hello,
We would have the below iRules which worked for us at BIG-IP 9.4.6 Build 401.0 Final version. We force https traffic to http and rewrite the answer from the pool member. Now we migrated the Virtual LoadBalancer to 11.4 and now the iRulse doesn't work for us.
when HTTP_REQUEST { if { not ([HTTP::uri] equals "/") } then { eval [LB::select] set orig_fqdn [HTTP::host] set selected_server "[LB::server addr]:[LB::server port]" if { [HTTP::host] contains "ourdomain.com" } { HTTP::header replace host $selected_server } } else { HTTP::redirect "/website/Welcome.do" } }
when HTTP_RESPONSE { if { [HTTP::is_redirect] }{ HTTP::header replace Location [string map [list $selected_server $orig_fqdn] [HTTP::header Location]] if { [HTTP::header "Location"] contains "http://" } { HTTP::header replace Location [string map [list "http://" "https://"] [HTTP::header Location]] } } }
Please let me know if you have any resource concerning the new feature of iRule or the differences between the 9.4.6 and 11.6 iRule .
Best Regards,
Csaba
4 Replies
- Kevin_Stewart
Employee
Give this a shot:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "/website/Welcome.do" } else { eval [LB::select] set orig_fqdn [HTTP::host] set selected_server "[LB::server addr]:[LB::server port]" if { [HTTP::host] contains "ourdomain.com" } { HTTP::header replace host $selected_server } } } when HTTP_RESPONSE { if { [HTTP::is_redirect] } { HTTP::header replace Location [string map [list $selected_server $orig_fqdn] [HTTP::header Location]] if { [HTTP::header "Location"] contains "http://" } { HTTP::header replace Location [string map [list "http://" "https://"] [HTTP::header Location]] } } } - Micros_88999
Nimbostratus
Hello,
No the url still hanging, it doesn't add the simple suffix either.
Best Regards,
Csaba
- Kevin_Stewart
Employee
I believe there's an issue with HTTP::is_redirect in 11.4 (and 11.5). Are you seeing any errors in /var/log/ltm? Please try the following:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "/website/Welcome.do" } else { eval [LB::select] set orig_fqdn [HTTP::host] set selected_server "[LB::server addr]:[LB::server port]" if { [HTTP::host] contains "ourdomain.com" } { HTTP::header replace host $selected_server } } } when HTTP_RESPONSE { if { [HTTP::header exists Location] } { HTTP::header replace Location [string map [list $selected_server $orig_fqdn] [HTTP::header Location]] if { [HTTP::header "Location"] contains "http://" } { HTTP::header replace Location [string map [list "http://" "https://"] [HTTP::header Location]] } } } - Micros_88999
Nimbostratus
Hello,
No There wasn't any log in there. But we had to move this site to production so we made a workaround which will be the final solution.
Thanks for your help in this case, but this IRule is unnecessary for us now.
Best Regards,
Csaba
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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