Forum Discussion
Robert_Pagano_7
Nimbostratus
Dec 29, 2005best way to move redirect function from Linux/Apache server to BIG-IP LTM?
I am trying to use a BIG-IP LTM box to replicate the functionality currently provided by a Linux/Apache server which is virtual hosting a number of domains.
The Linux/Apache server is basically just acting as a "redirect server" for a number of our domains. If a user, for example, types "www.somedomain.com" into their browser, the request is handled by the server (using the Apache "rewrite engine") such that the client is redirected to "somedomain.com." The server handles approximately twenty domains in this fashion.
I have configured an "HTTP redirect" rule on the BIG-IP before and it works fine; but it is a simple "one-for-one" redirect (one virtual IP, one URL) and just redirects clients to use https rather than http. The Linux/Apache environment is a "one-to-many" (one IP, many URLs) arrangement and redirects clients to different hostnames.
I would imagine that the F5 can somehow replicate the Linux/Apache virtual hosting and redirect functionalities but I am not sure about the best way to implement it (multiple "if" statements in an HTTP redirect rule?).
I am concerned about the scalability and performance impact of any such implementation.
The BIG-IP box in question is a model 2400 -- operating in "one-arm mode" -- and is running "4.5PTF-07 Build18" code.
FYI, here is a (slightly modified) snippet of the Linux/Apache box's httpd.conf file...
------------------
NameVirtualHost AAA.BBB.CCC.248
============ Default Action ======================
ServerAdmin techcontact@bogus.domain.com
ServerName AAA.BBB.CCC.248
ServerAlias AAA.BBB.CCC.248
RewriteEngine On
RewriteRule ^/(.*) http://bogus.domain.com
==================================================================
ServerAdmin techcontact@bogus.domain.com
ServerName www.bogus.domain.com
ServerAlias www.bogus.domain.com
RewriteEngine On
RewriteRule ^/(.*) http://bogus.domain.com/$1
==================================================================
ServerAdmin techcontact@bogus.domain.com
ServerName www.anotherbogus.domain.com
ServerAlias www.anotherbogus.domain.com
RewriteEngine On
RewriteRule ^/(.*) http://anotherbogus.domain.com/$1
------------------
Any assistance will be greatly appreciated.
Thank you.
- Robert_Pagano_7
Nimbostratus
Thanks for the reply. - Colin_Walker_12Historic F5 AccountYes, that's the kind of syntax you'd use. Though I'd recommend using elseif statements after the first if. This way the rule won't keep evaluating all the statements after it finds a match.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects