Forum Discussion
Adding HTTPS redirtct to existing iRule
Greetings - I am trying to edit an existing iRule so that http requests are redirected to https. The issue is, I have several elseif statements in this iRule that I do not want redirected to https. Below is the existing iRule. Can I redirect http requests for the first if statement only?
when CLIENT_ACCEPTED { SSL::disable if {([TCP::local_port] == 443 )} { SSL::enable pool MWSTEST_MDU_COM_HTTPS_POOL } elseif {([TCP::local_port] == 8090 )} { pool MWSTEST-MDU-COM_8090_POOL } elseif {([TCP::local_port] == 8000 )} { pool MWSTEST-MDU-COM_8000_POOL } elseif {([TCP::local_port] == 8085 )} { pool MWSTEST-MDU-COM_8085_POOL }
else reject }
1 Reply
- P_K
Altostratus
Try this
You can create a HTTPS VIP(say https_vip) with clientssl profile and assign this(MWSTEST_MDU_COM_HTTPS_POOL) pool to it.
Then your iRule looks like this:when HTTP_REQUEST {
if {([TCP::local_port] == 443 )} {
virtual https_vip
} elseif
.
.
.Hope this works!
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