Forum Discussion
Reverse proxy for login page
Hi,
I'm running a BigIP cluster with v11.2HF2. Here is my question.
I have a website hosted by a third party (let's call it THIRDPARTY) for my company (let's call it MYCOMPANY). . This site displays the THIRDPARTY logo.png on the login page, and then the MYCOMPANY logo once loggued in.
My customers log in at www.thirdparty.com today. I want to put MYCOMPANY logo on this login page instead of THIRDPARTY's one (who can't change this logo as it's shared among several other customers).
My idea is to make www.mycompany.com points to my BigIP, get some stuff rewritten so it displays my logo instead of the THIRDPARTY one, and then get everything as usual (it's not a problem if customers see www.thirdparty.com in the URL when they use the site). It's even prefered because I don't want a dependancy on my BigIPs for the entire application, I just want to handle the login page).
I already have defined my virtual server, an iFile with my logo, but I'm stuck. I've something like:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/images/THIRDPARTY.png" } {
HTTP::respond 200 content [ifile get MYCOMPANY_logo_img]
} else {
??? /* show me the content of the normal site */
}
}
Can it be handled like this? Do you see another option?
Thanks!
- What_Lies_Bene1
Cirrostratus
Could you not do a redirect instead and avoid using an iFile? I've never done it but it should work. - nitass
Employee
I already have defined my virtual server, an iFile with my logo, but I'm stuck.what are you getting now? - CSA
Nimbostratus
I used an iFile and not a redirected because I wanted the logo file to be hosted on the BigIPs (I don't want to rely on another wbe server just to provide an image).
- What_Lies_Bene1
Cirrostratus
Using the initially described iRule the host header won't need to be rewritten as a real server will never see the request for the image. - CSA
Nimbostratus
@nitass: I have nothing right now. I'm thinking how to do it. Not sure i get what you meant, but I don't want to define thirdparty.com as a pool. I just want to rewrite some part of the login page of a website. Then use the website as usual, without going through my BigIPs. - Kevin_Stewart
Employee
Assuming you're just talking about replacing the logo, your code should work fine and an iFile is an excellent way of accomplishing the image replacement.if { [HTTP::uri] eq "imagesTHIRDPARTY.png" } { HTTP::respond 200 content [ifile get MYCOMPANY_logo_img] }
- What_Lies_Bene1
Cirrostratus
But don't you have servers hosting this image anyway? - Brian_69413
Nimbostratus
I don't understand how the request for this image is ever going to hit your BigIP if the site is being hosted somewhere else... - Kevin_Stewart
Employee
Forgot one thing. A URI will always start with a forward slash: - What_Lies_Bene1
Cirrostratus
Regardless of the irule, you might find that relative links in the responses mean that the traffic keeps going via the BIG-IP!
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