cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.
jkirankumar1993
Nimbostratus
Nimbostratus

Problem this snippet solves:

Divert external rest api traffic to a node

How to use this snippet:

Implement this irule in load balancer

Code :

when HTTP_REQUEST {

log local0. "New code"
set referrer_host [ URI::host [HTTP::header value Referer]]
log local0. "host: [HTTP::host]"
log local0. "uri: [HTTP::uri]"
log local0. "path: [HTTP::path]"
log local0. "Referer: $referrer_host"


if { ([HTTP::header exists "Referer"]) } {   

   if { $referrer_host eq "" } {
           set referrer_host "none"
           }

  if { !($referrer_host contains "jiratest.corp.chartercom.com") } {

log local0. "referrer is not equal to jira"
    if { ([HTTP::uri] contains "/rest/") } {
log local0. "referrer is not equal to jira and contain rest"
      pool JIRA-test-external-pool
    } else {
    pool JIRA-test-pool
    }
    
  } else {
  log local0. "referer is jira"
  pool JIRA-test-pool
  }

} else {
log local0. "Referer does not exist"
   pool JIRA-test-external-pool
 }


}
Version history
Last update:
‎14-Feb-2018 11:16
Updated by:
Contributors