Forum Discussion
http to https VIP
hi all,
so we have an application that requires connecting to a specific URL, but this application only supports "http". we happen to have an "https" URL that this application needs to connect to, so I though of creating a VIP that listens on port 80, and then plugged the URL as a pool member on port 443.
this seems to get the initial connection to work, but then the URL sends a redirection to the client, and Yes it is "https" so when the client attempts to connect to the VIP on 443, of course it fails.
so I was wondering if there's a way to resolve this problem using an iRule.
anyone can help with this :)
Thanks
44 Replies
- mj_almassud_136
Nimbostratus
could you please post the exact syntax for the command?
- Cory_50405
Noctilucent
From tmsh, list ltm virtual virtualservername
- Arie
Altostratus
Cory's iRule includes a check to see if the host value contains a string. However, the screen capture of the TCP stream shows no value for the host. Did you remove it from the image or is it indeed blank?
- mj_almassud_136
Nimbostratus
I removed it to avoid violating company policies.
sorry, I should have mentioned that or replaced it with a text that says "Removed"
- Arie
Altostratus
OK - makes sense. However, there doesn't seem to be a header "Content-Type" in the server response. The iRule requires it, though. Have you tried removing that check from the iRule?
- mj_almassud_136
Nimbostratus
I speak through images to be precise:
- Arie
Altostratus
Thanks - that is helpful.
However, it does appear that there is no HTTP Response Header "Content-Type" in the server response. This would keep the code in the if-statement from being triggered.
- Cory_50405
Noctilucent
So let's modify the if statement to this and see if that makes a difference:
when HTTP_REQUEST { Save the requested host value set host [string tolower [HTTP::host]] Disable the stream filter by default STREAM::disable } when HTTP_RESPONSE { Check if response type is text and host isn't null if {$host ne ""}{ Replace https://$host with http://$host STREAM::expression "@https://$host@http://$host@" Enable the stream filter for this response only STREAM::enable } } - mj_almassud_136
Nimbostratus
This seems promising and I think it'll work. I did some testing on it, but I can't do a full test right now, because I am out the rest of the week and I don't have access to all the information that I need to complete this test.
as of now, I am getting the login failed back from the server, which means that I am making all the way to the server and getting the response back as expected and it's all showing http on the browser address bar.
- Cory_50405
Noctilucent
Good to hear.
- mj_almassud_136
Nimbostratus
it worked beautifully.
Thank you so much for your help.
MJ
- Vishu_Rao_12264
Nimbostratus
Hi MJ
I have the same requirement and followed suggestions made by Cory but it seems for me it did not work. Can you help me more on this?
Still my server redirecting to HTTPs not http.
-Vishu
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