Forum Discussion
French_Poul_307
Nimbostratus
Jun 10, 2010iRules for reverse proxy
Hello,
First, I'm sorry for my english ; I'm french and I talk a very bad english...
I'm new with BigIP and with iRules, so I have some difficulties to do what I want... :-(
I have a BigIP 6900, and I try to use it like a load balancer (normal!) but like a reverse proxy too... I have understand that I must use iRules, but I would like to know what iRules I must use to select the http requests which are good (no errors, crc ok, ...) ?
I have read the wiki of iRules, but I don't find a solution...
Thank you in adavance for your help!
11 Replies
- Michael_Yates
Nimbostratus
Your request for information is is pretty broad, but I will give you an example. You must decide what is good traffic in order to route it to a specific pool of servers, and what to do with the rest of the traffic (whether it is bad or doesn't meet any of the criteria set earlier in the iRule).when HTTP_REQUEST { switch -glob [string tolower[HTTP::uri]] { "/english*" { pool pool.for.english } "/french*" { pool pool.for.french } "/german*" { pool pool.for.german } default { HTTP::redirect http://[getfield [HTTP::host] ":" 1]/english } } }
- French_Poul_307
Nimbostratus
Since yesterday, I have learned some information about the bigIP, and it's true, my question is broad...! - Michael_Yates
Nimbostratus
If these were the possible URL's tied to a Virtual Server: - French_Poul_307
Nimbostratus
Hope this helps. - Michael_Yates
Nimbostratus
HTTP::redirect is a full 302 redirect, so you have to provide it the entire URL.when HTTP_REQUEST { if { not ([HTTP::uri] equals "/french/") } { HTTP::redirect "http://[getfield [HTTP::host] ":" 1]/french/" } }
- French_Poul_307
Nimbostratus
Ok, your solution works.ERROR The URL asked can't be loaded Trying to load the URL : http://xxx.xxx.xxx.xxx/english This error was meet : Error of reading The system returned : (104) Connection reset by peer One error is being trying to acceed to the network.
- The_Bhattman
Nimbostratus
Hi French, - The_Bhattman
Nimbostratus
Hi French, - hoolio
Cirrostratus
The square braces act like backticks to execute a command. So if you want to retrieve the value for the URI, you would use [HTTP:uri]. If you want to set the URI you would not want to use the square braces: HTTP:uri "/cacti/[HTTP:uri]" - French_Poul_307
Nimbostratus
Ok! Thanks Bhattman and hoolio, it's more clear for me!
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