Forum Discussion
big_9869
Nimbostratus
May 17, 2013http redirect using tcp
Hi Folks
good morning
I'm new to iRules so I hope I'm not asking something thats been answered previously
I want to do an http redirect but I don't want to use http since the VIP is a ge...
Kevin_Stewart
Employee
May 30, 2013Reference: https://devcentral.f5.com/community/group/aft/2167033/asg/50
Give this a shot:
when CLIENT_ACCEPTED {
switch [TCP::local_port] {
"80" {
SSL::disable clientside
TCP::respond "HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nWhere I want you to end up"
TCP::close
}
"443" {
return
}
default {
reject
}
}
}
when CLIENTSSL_HANDSHAKE {
SSL::collect
}
when CLIENTSSL_DATA {
SSL::respond "HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nWhere I want you to end up"
TCP::close
}
I tested this with a wildcard port VIP (IP:0) on 11.3 with an assigned client SSL profile. I had to have a pool assigned for the SSL::respond to work, though I can't remember why.
So curiously, you'd rather do a meta refresh than just send a 302?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
