Forum Discussion
dyobbs_25515
Nimbostratus
Feb 03, 2012iRule to redirect a variable to http
Guys hi,
I'm newbie here. I wanted to create an iRule, that truncates the later part of the message from the "http://.acme.com" to http://
any help is appreciated.
Will this work?
when HTTP_REQUEST {
if { [HTTP::uri] starts_with ".acme.com" } {
HTTP::redirect "http://[HTTP::host]"
}
24 Replies
- nitass
Employee
I have to use HTTP_referrer in it..........., i would like to have as http_referrer (which is used for that : http://en.wikipedia.org/wiki/HTTP_referer) wth the original DNS calledi replied in another discussion.
Http_referrer in iRule
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2161192/showtab/groupforums/Default.aspx
Can this maintain persistent session? Any traffic that goes into this iRule should have persistent session on the cache servers.
What can we put in?it seems your post is not complete. anyway, what persistence method do you want?
is carp applicable?
sol11362: Overview of the CARP hash algorithm
http://support.f5.com/kb/en-us/solutions/public/11000/300/sol11362.html - dyobbs_25515
Nimbostratus
Nitass,
thanks! for the 2nd query, here's the setup:
SETUP:
1.Inbound and outbound traffic falls on the same VLAN. Using same interface.
2.INBOUND: From internet to firewall to F5
3.OUTBOUND: F5 to Cache servers
4.Inbound VS is configured with 2 members ( Cache 1 and Cache 2)
5.Used iRule to rewrite URL
6. Servers are on the same VLAN as the self-ip. (only one interface active for F5)
OPERATION:
1.Client initiates HTTP request with URL: www.google.com.acme.com.nz
2.URL goes to public FW IP, this get NATed then goes to the F5 box
3.With iRule, acme.com.nz gets truncated, then returns back www.google.com to the client browser.
4.This is working, and F5 rewrites it.
Queries:
What happens to the succeeding traffic upon rewrite?
Does it go direct to the pool members?
Do we need persistence on this, to make it force to go the succeeding traffic?
How can we put succeeding traffic will always go to f5 for it to be cached?
or will just be an iRule telling the traffic to go to pool members?
Sorry for the lot of queries.
I tried it on my browser. It seems like after the first hit, user gets the rewritten URL, then goes back to the normal traffic, bypassing F5.
thanks! - dyobbs_25515
Nimbostratus
Nitass hi,
In simple terms, F5 needs to pass the request to proxy ( cache servers) upon rewriting the URL.
user-->F5[rewrites URL] & [forward request] --> Proxy (Cache) / Cache acts as proxy, then respond to user. - nitass
Employee
i put question in your new post below.
iRule rewrite then forward request to pool
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2161231/showtab/groupforums/Default.aspx
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
