Forum Discussion
URL Redirect iRule Question
Can anyone tell me if the action below is possible using an iRule or some other method on the LTM?
User connects to www1.abc.com. The LTM redirects this to abc.corp.com. But, the user still needs to see www1.abc.com in their browser bar even thogh they have been redirected to abc.corp.com.
15 Replies
- Kevin_Stewart
Employee
You could technically route the traffic through the LTM. Set the pool to point to abc.corp.com and make sure the LTM has a route to this address. Depending on the complexity of the remote application, you may need to rewrite links and object references coming from that remote site, which could either be done with a STREAM profile (for simple stuff) or ProxyPass (for more complicated environments).
- kend
Altostratus
Will the ProxyPass iRule in the CodeShare section do what I am asking?
- Kevin_Stewart
Employee
What you're asking for could be really easy, or really hard, and it depends entirely on the application you're sitting in front of. For example, just to go to Google Docs, the browser touches no less than 35 separate servers. This would be a nightmare to proxy even for ProxyPass. If the application is not that complicated, then I'd say ProxyPass would be a good fit. The idea is that the remote application would IP space would be assigned to a pool, and ProxyPass would rewrite incoming and outgoing URL references.
- kend
Altostratus
Fortunately, it is not a complicated application. I am trying the ProxyPass iRule, but it is not working. When I connect to www1.abc.com, the URL in my browser bar changes to "http://www1.abc.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/abc.corp.com/" and I recieve a "Server Error in '/' Application. Runtime Error..." page.
- kend
Altostratus
I corrected the problem I stated above. But, now, when I connect, I don't get to the webpage and the following messages are placed in the LTM log.
Rule ProxyPass : VS=vs_abc_http, Host=abc.corp.com, URI=/: No rule found, using default pool pool_abc_http_https and exiting
Rule ProxyPass : VS=vs_abc_http, Host=abc.corp.com, URI=/welcome.png: No rule found, using default pool pool_abc_http_https and exiting
Rule ProxyPass : VS=vs_abc_http, Host=abc.corp.com, URI=/welcome.png: No rule found, using default pool pool_abc_http_https and exiting
Rule ProxyPass : VS=vs_abc_http, Host=abc.corp.com, URI=/favicon.ico: No rule found, using default pool pool_abc_http_https and exiting
- Kevin_Stewart
Employee
What does your data group look like? At a minimum you should have something like this:
www1.abc.com/ := abc.corp.com/Where the users access the VIP using the www1.abc.com URL and ProxyPass translates that to the abc.corp.com URL.
- kend
Altostratus
Well, I found out some new information today from our web server team and I think that is why the iRule is not working. www1.abc.com is a web server with an external IP of x.x.x.x. The web server abc.corp.com is in a pool on the LTM which is assigned to the virtual server. www1.abc.com is configured to redirect to the IP of the virtual server of the LTM which resolves to abc.corp.com. So, the LTM sees the request coming from abc.corp.com and the iRule does not work since the data group is set for www1.abc.com/ := abc.corp.com/. So, it doesn't appear this iRule will work since the users are not connecting directly to the LTM.
- Kevin_Stewart
Employee
I think there's something missing here. You have a web server (www1.abc.com) that redirects to abc.corp.com. My understanding from what you've said is that abc.corp.com is both a VIP on the BIG-IP AND a (remote) web server sitting in a pool behind the BIG-IP. Is that correct?
- kend
Altostratus
Let me try and clarify. www1.abc.com is a web server with a public IP of x.x.x.x. abc.corp.com is a web server that is in a pool on the LTM. That pool is assigned to a virtual server on the LTM. That virtual server has a public IP of y.y.y.y. When the user connects to www1.abc.com, it redirects them to the virtual server IP of y.y.y.y and then to the pool with abc.corp.com. So, since www1.abc.com is redirecting the connection to the VS IP, the LTM sees the request as coming from abc.corp.com. The iRule and data group would work if the user connected directly to the LTM as www1.abc.com and did not get redirected from a that server. Does that make sense?
- RickM
Nimbostratus
Sounds to me like you don't really want a redirection, but there may be more to your requirements than you have shared.
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