Forum Discussion
paul_dcc
Nimbostratus
Feb 29, 2012HTTPS Redirect to a new Port number
We have a number of user that forget to put :9614 on the end of the url they are trying to connect to and then get Internet Explorer cannot display the webpage (https://sspr.dorsetcc.gov.uk/) when it should be (https://sspr.dorsetcc.gov.uk:9614/)
Is there a way I can do this via an IRule
10 Replies
- Bayan_El_Ameen1
Nimbostratus
Hello Paul,
I think you can do it hopefully by following theses steps in case your VS is using the service port 9614:
- First create a VS on port 443
- Create an iRule that only redirects to https://sspr.dorsetcc.gov.uk:9614/
- Assign the iRule to the new VS
In this way all the new connections on https only will be redirected to the one with the port number
Hope it works for you.
Thanks,
Bayan - paul_dcc
Nimbostratus
I forgot to mention that this is running on ASM, do you think it will still work ? - Bayan_El_Ameen1
Nimbostratus
Yes it should since the traffic will be redirected to the original VS though it should pass in ASM. - paul_dcc
Nimbostratus
Hi Bayan,
Not sure if I've done my IRule correct, but If I have doing what you said did not work.
when HTTP_REQUEST {
Check host header value
if {[string tolower [HTTP::host]] eq "https://sspr.dorsetcc.gov.uk"}{
Redirect client to the full host name
HTTP::redirect "https://sspr.dorsetcc.gov.uk:9614/showLogin.cc[HTTP::uri]"
}
} - Antony_413
Nimbostratus
Its simpler that even that, non-port secified https:// goes to port 443, setup the samp VIP with port 443 and apply the redirect iRule (my guess here is that there is nothing listening specifically on 443 though? if so, then re-insert the string check)
The URI part will already have "/showLogin.cc" in it so just put that on the end of the host section.when HTTP_REQUEST { Redirect client to the full host name HTTP::redirect "https://[HTTP::host]:9614[HTTP::uri]" } - Bayan_El_Ameen1
Nimbostratus
you can do it as simple as this:when HTTP_REQUEST { HTTP::redirect "https:///sspr.dorsetcc.gov.uk:9614[HTTP::uri]" } - Antony_413
Nimbostratus
Great debugging trick for seeing what you are putting out to the browser is to insert a logger too (look in your ltm logs for it)
log local0. "https://[HTTP::host]:9614[HTTP::uri]" - paul_dcc
Nimbostratus
Do I need to create two VS, one with the 443 address on and the other with the 9614 on ? - Antony_413
Nimbostratus
yes two separate VIPs one for 443 and the one you have listening on 9614.
If you are asking that question are you using a carte blanche all ports on your existing VIP ? - paul_dcc
Nimbostratus
Hi Antony, that irule worked fine with the two VIP's
Many Thanks
Paul
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
