Assistance requested with HTTPS Response Redirect - VMware Platform Services Controller

Still very new to F5 and F5 projects. Would appreciate guidance regarding a particular configuration. Working with a VMware team to set up an F5 BIG-IP load balancer for use with vSphere Platform Services Controller (PSC) 6.0.

VMware’s knowledge base article: https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT\_KB\_1\_1&externalId=2098006

Following the article’s instructions was simple enough (slight snag when setting up the server profile and receiving a “key” error; but that was resolved).

Issue: after a workstation uses a web browser to connect to the https://psc.company.com web site, the URL in the browser changes to https://node1.company.com instead of remaining https://psc.company.com.

iRules and much of the Profile stuff are new to me. I read through several F5 KBase and Dev articles. While it appears that a properly constructed iRule - applied in the correct place - would resolve the issue, I noted that a 2005 question had a response from a “drteeth” that indicated that the redirect portion of the http profile could be used for this.

Using the Configuration Utility, I went to Local Traffic > Profiles | HTTP, clicked Create, used “http” as the parent.

Under Settings, changed Redirect Rewrite from None to ALL (tried Nodes as well). Named the new profile PSC_http_response_redirect. Saved changes.

Next, tried modifying just the main Virtual Server, the 443 virtual server. Edited the virtual server. Went under Configuration and changed HTTP Profile from None to PSC_http_response_redirect. Saved changes.

Tested the web site. Went to psc.company.com and node1.company.com was returned. I then modified all remaining psc-related virtual servers so that they, too, had the HTTP profile of PSC_http_response_redirect. Tested the web site. Went to psc.company.com and node1.company.com was returned.

Would you please help me figure out what is missing or needs to be changed?

Thank you very much.

John

I tried several other configurations which I thought may work.

Here is one:

An iRule applied to the 443 virtual server: when HTTP_RESPONSE { HTTP::header replace Host “psc.company.com” }

Result: no change

Note: currently using a 45-day trial license with v11.6.1. When configuration is stable, it will eventually be moved to physical F5s running 12.1.0.

Another attempt did not produce any changes in the results. Used: 404 Page not found | BIG-IP Documentation Section: Creating a Rewrite profile to specify URI rules

Creating a Rewrite profile to specify URI rules

To configure the BIG-IP system to perform URI translation, you create a Rewrite profile, specifying one or more URI rules that associate a client-side path with a server-side URI. You also specify whether you want the URI translation to pertain to HTTP requests, responses, or both.

On the Main tab, click Local Traffic > Profiles > Services > Rewrite. The Rewrite profile list appears.
Click Create New Profile. The Create New Profile Rewrite popup screen appears.
In the Profile Name field, type a name, such as my_rewrite_profile.
From the Parent Profile list, select rewrite.
From the Rewrite Mode list, select URI Translation.
On the left pane, click URI Rules. An empty text box appears for displaying client-server URI mappings that you specify.
Click Add.
From the Rule Type list, select Both.
In the Client URI box, type a client path, such as /sales/.
In the Server URI box, type a server URI, such as http://appserver1.siterequest.com/sales/. You must include a scheme in the server URI that you specify. An example of a scheme is http.
Click OK. This displays a mapping of the specified client path to the associated server scheme, host, and path.
Click Add again.
From the Rule Type list, select Both.
In the Client URI box, type a client path, such as /marketing/.
In the Server URI box, type a server URI, such as http://appserver2.siterequest.com/marketing/. You must include a scheme in the server URI that you specify. An example of a scheme is http.
Click OK. This displays a mapping of the specified client path to the associated server scheme, host, and path.
Click OK.

The BIG-IP system now includes two URI rules for performing URI translation on both requests and responses. For example, the host name in a request destined for Hybrid Multicloud App Security & Delivery for the AI Era | F5 will be translated to http://appserver1.siterequest.com/sales/, and the host name in a request destined for https://www.siterequest.com/marketing/ will be translated to http://appserver2.siterequest.com/marketing/. A reverse translation occurs on any response.

Again, this did not produce any changes in the results. Using the web browser to go to https://psc2.company.com still results in the web browser showing https://node1.company.com.

Thoughts?

you could have a look at the proxypass irule: https://devcentral.f5.com/codeshare?sid=646

it can do more but one of the things is thing and that might make it easier then building your own from scratch.

boneyard, I can take a look at the proxypass iRule, but please note that F5 documentation states: “Important: The BIG-IP reverse proxy feature replaces the ProxyPass iRule available on the F5 Networks site Hybrid Multicloud App Security & Delivery for the AI Era | F5”

 

 

I tried using a “rewrite” profile. No change in results. (see post above for details)

 

Thanks

 

The symptoms made me question whether or not the response traffic (from the back-end servers to the client workstations) is actually going back through the F5. If not, this would explain why the rewrite profile is not having an effect.

I am reviewing iRule “101” docs and similar items posted inn DevCentral.

Assuming the traffic flow is Client → VIP → Back-End-Server → VIP - Client, it seems to me that a simple iRule applied to the HTTPS VIP with a “http” profile assigned to it should do the trick.

Here is what I have now: An iRule applied to the 443 virtual server: when HTTP_RESPONSE { HTTP::header replace Host “psc.company.com” }

Just for the heck of it, I applied this iRule to All VIPs related to this server (PSC).

I started using tools such as ssldump, tcpdump, openssl, wireshark, and cURL.

When cURL was used, I noted this in what I believe to be the HTTP_RESPONSE: So… one goes to https://psc.company.com and one gets back https://back-end-server.company.com/websso. Note that, if the SSL is working, the web browser does show “https” for the URI. I noticed that the information pulled from cURL showed “http” and NOT “https.”

In any case, I would have thought the iRule with the replace statement (as per above) would have worked.

What am I missing? (keep in mind, I am new to tracking down anything web/http/https related and to iRules as well)

Thanks!

In case my post wasn’t clear, despite using the simple HTTP_RESPONSE line noted above, the issue persists… going to https://psc.company.com results in the web page showing https://back-end-server.company.com/websso.

Additional updates follow.

1) A BIG THANK YOU goes to specific F5 personnel who have assisted where possible. Names withheld to protect the innocent (seriously), but you know who you are and I know you read comments - so thanks.

Note: the F5 web page is complaining about the text I am posting, so I am going to break it down bit by bit.

2) With guidance, an Access Policy Manager wizard was used to create a Access Profile, Connectivity Profile, and other behind-the-scenes configurations which I have yet to figure out. The result was that when going to https://www.company.com, the web browser retained the www.company.com instead of replacing it with node1.internal.company.com. An undesired side effect is that the F5 added a long string of text after the host name and prior to the Location (if I am getting terminology correct) itself. So, instead of seeing https://www.company.com/websso, the web browser shows something like https://www.company.com/f5-6jklaskldjklj21asdjklfjal12jklasjlkdfasjlkjasdk$$/websso. Obviously, this is still not ideal, so back to the drawing board I go.

3) It has become obvious that I need to find an authoritative informational source detailing the components (again, terminology?) available within each section of the HTTP space. For example, [HTTP::host] is apparently not a valid component of an HTTP_RESPONSE (or so said the iRule checker), while [IP::server_addr] is. However, [HTTP::host] is valid within an HTTP_REQUEST. As you can gather, it is necessary to understand all of the HTTP “parts” (such as REQUEST, RESPONSE, CLIENT_ACCEPT, and so on) and then what components (or “variables,” although I believe this is a misnomer in this context) are available within each “part.”

Would someone please be able to provide information (link, title, etc.) regarding such an authoritative source to explain all the “things” iRules can work with?

I have checked out most of the readily accessible work in DevCentral and none of that material addresses this need, good though the material may be.

4) In an attempt to better understand iRules and HTTP, I have begun writing simple logging rules. Thanks to various sources on DevCentral for the bits of code that I am using and coupling together.

Here is an example of the iRule:

when CLIENT_ACCEPTED {
log local0. "Client Accepted.  Client IP: [IP::client_addr]"
}

when HTTP_REQUEST {
log local0. "Request from IP [IP::local_addr] for hostname [HTTP::host] and URI [HTTP::uri]"
}

when HTTP_RESPONSE {
log local0. "Response from IP [IP::local_addr] with server IP address [IP::server_addr].  URI not valid in this context."
}

Notes: Not available in HTTP_RESPONSE:

  • HTTP::host, HTTP::uri, HTTP::server

Output from the Logs: (IPs, of course, have been replaced with substitute values) Where:

  • 192.168.2.2 is the Non-floating Self-IP of the F5 within the 192.168.2.x vlan.
  • 192.168.2.75 is the IP of the Virtual Server hosting https://www.company.com.
  • 192.168.2.91 is the IP of the “node1” back-end server that makes up one of the Members of the Pool.
  • 192.168.1.51 is the IP address of the external workstation attempting to access https://www.company.com

Rule /Common/RL_InformationSeekingAndLogging : Client Accepted. Client IP: 192.168.1.51

Rule /Common/RL_InformationSeekingAndLogging : Request from IP 192.168.2.75 for hostname psc2.oma.spawar.navy.mil and URI /

Rule /Common/RL_InformationSeekingAndLogging : Request from IP 192.168.2.75 for hostname psc2.oma.spawar.navy.mil and URI /f5-w-687474703a2f2f707363322e6f6d612e7370617761722e6e6176792e6d696c$$/

Rule /Common/RL_InformationSeekingAndLogging : Response from IP 192.168.2.2 with server IP address 192.168.2.91. URI not valid in this context.

Rule /Common/RL_InformationSeekingAndLogging : Request from IP 192.168.1.75 for hostname and URI /f5-w-68747470733a2f2f69732d7073632d61766930312e6f6d612e7370617761722e6e6176792e6d696c$$/websso/

For brevity and clarity, the actual directory structure listed below is being abbreviated as /tmp.

Executed the following command in order to see what was going on under the hood:

curl [https://psc.company.com](https://psc.company.com) --anyauth --cookie-jar /tmp/psc_cookies.txt --dump-header /tmp/psc_headerdump.txt --cacert /tmp/ca.crt --output /tmp/pscout.txt --trace /tmp/psc_trace.txt

The contents of pscout.txt:

1) Am I correct that it is the HTTP_RESPONSE that includes the information depicted by pscout.txt?

2) Let’s assume the “backendnode1” information is not in the Body of the response. It is my understanding that this means that a STREAM profile will not help. Correct?

3) How can the “meta http-equiv content” information be modified using an iRule? Would anyone please provide sample code for this function?

Thank you for any and all input.

John K. Weaver

Hi WeaverJK,

In my installation of 2 PSCs behind a F5 load balancer, I have the same issue. When I open the VIP in a web browser, I’m redirected to my active PSC. Did you find the solution ?

Thanks in advance.

Regards,

Nicolas