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
- Cory_50405
Noctilucent
Odd. The server should never see the client's IP address when using SNAT.
Do you have address and port translation enabled on the virtual server?
- mj_almassud_136
Nimbostratus
false alarm. I mistakenly thought that I saw the actual IP of the web server, but it's really not, so the SNAT Pool: Auto Map is doing it job correctly.
- Cory_50405
Noctilucent
Okay, so in the client capture, did you still see any redirects coming back specifying HTTPS? Just trying to determine what if any progress has been made so far.
- mj_almassud_136
Nimbostratus
I had to remove the IPs, but I am seeing the same exact behavior, where the client is getting redirected to https, and it's trying ot connect to the VIP on 443, which of couse does not work.
- Cory_50405
Noctilucent
Break out that 200 OK message. What's inside of it?
- mj_almassud_136
Nimbostratus
I was looking at that packet when you responded.
- mj_almassud_136
Nimbostratus
- Cory_50405
Noctilucent
Maybe the if{} statement is the problem. Try changing the iRule to this:
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 {[HTTP::header value Content-Type] contains "text" and $host ne ""}{ Replace http://$host with https://$host STREAM::expression "@https://$host@http://$host@" Enable the stream filter for this response only STREAM::enable } } - mj_almassud_136
Nimbostratus
the client still getting https as part of the redirection. I think it's int the payload and it's not a response that the iRule is handling.
- Cory_50405
Noctilucent
The stream profile should still catch it.
Can you please post your virtual server configuration from tmsh?
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