Forum Discussion
Ravi_Kumar_G_16
Nimbostratus
Aug 07, 2014Need help in creating iRule
Hi All,
I need a iRUle which does the same work as following nginix rule
Nginix Rule
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type app...
IheartF5_45022
Nacreous
Aug 14, 2014Hi Ravi,
Here's a hint - just guessing a few bits and left out a few, but should get you started;-
pl_xbase_18080 members 192.168.10.101:18080 192.168.10.103:18080
pl_xiservice members 192.168.10.101:8090 192.168.10.103:8090
pl_xirest members 192.168.10.101:18080 192.168.10.103:18080
then;-
when HTTP_REQUEST {
set fRoot 0
switch [HTTP:: path] {
"/xinsights/services/xbase/" {
pool pl_xbase_18080
HTTP::uri "/xinsightsrest/xbase/"
}
"xinsights/xinsightsrest/ {
pool pl_xirest_18080
HTTP::uri "/xinsightsrest/"
}
"/xinsights/services/api/ {
pool pl_xiservice_8090
HTTP::uri "/api/"
}
"/xinsights/ui/" {
pool pl_xiservice_8090
HTTP::uri "/"
}
"/" {
set fRoot 1
}
}
when LB_FAILED {
HTTP::respond 502 content [class match -value "502" dg_5xx_pages] noserver Retry-After 300
}
when HTTP_RESPONSE {
if {$fRoot} {
HTTP::header insert Content-Type "application/json"
}
}
You can also use a Local Traffic Policy to perform many of the iRule statements above.
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