Forum Discussion

Brian_Gupta_115's avatar
Brian_Gupta_115
Icon for Nimbostratus rankNimbostratus
Sep 16, 2005

Sample ERP Portal iRule (I'd love to hear comments).

This is a rule for an ERP portal. The applications that are currently supported are HR, Financials and CRM. In addition to being a stand alone application, the portal will contract HTML pages that use elements from the different backend pools. IE: If I pull up a CRM page from portal the portal application will return a page that contains elements that will be serviced by both the Portal matchclass as well as the CRM matchclass.

(I did not list the URI classes, for security reasons. If you need help building them please let me know.)

Please note that I turn on and off individual functions of the load balancer for certain pools. (e.g. Some applications need source IP tracking so I disable SNAT.)

One reason we went down this route, is so that we could launch the portal prior to having the applications integrated with the portal. In retrospect, it was a great decision, as it has given our application team a great deal of flexibility.


rule portal_parse {
  when HTTP_REQUEST {
  set my_uri [string tolower [HTTP::uri]]
  set usessl 0
 Redirects for legacy URIs
  if { $my_uri starts_with "/servlets/iclientservlet/hr" } {
    redirect to "/hr"
  } elseif { $my_uri starts_with "/servlets/iclientservlet/selfservice" } {
    redirect to "/selfservice"
  } elseif { $my_uri == "/hr" } {
    redirect to "/HR/signon.html"
  } elseif { $my_uri == "/selfservice" } {
    redirect to "/SELFSERVICE/signon.html"
  } elseif { $my_uri == "/payroll" } {
    redirect to "/PAYROLL/signon.html"
 Redirects individual apps to Portal signon page. (This will generate a session cookie that is respected by all the apps)
  } elseif { $my_uri == "/finti" } {
    redirect to "/FINTI/signon.html"
  } elseif { $my_uri == "/finspc" } {
    redirect to "/FINSPC/signon.html"
  } elseif { $my_uri contains "/finti/?cmd=login" } {
    redirect to "/psp/PAEP/?cmd=login"
  } elseif { $my_uri contains "/finspc/?cmd=login" } {
    redirect to "/psp/PAEP/?cmd=login"
  } elseif { $my_uri contains "/crmp/?cmd=login" } {
    redirect to "/psp/PAEP/?cmd=login"
  } elseif { $my_uri == "/paep" } {
    redirect to "/PAEP/signon.html"
  } elseif { $my_uri == "/crmp" } {
    redirect to "/CRMP/signon.html"
 Check for portal URIs, must be first because other application URIs are embedded in the query string
  } elseif { [matchclass $my_uri contains $::ps_portal_uris] } {
    pool ps_pa_ssl
    snat none
    set usessl 1
 Check for URIs of other applications
 Reporting URIs
  } elseif { [matchclass $my_uri contains $::ps_rpt_hrms_uris] } {
    pool ps_rpt_hrms_ssl
    set usessl 1
  } elseif { [matchclass $my_uri contains $::ps_rpt_fin_uris] } {
    pool ps_rpt_fin_ssl
    set usessl 1
  } elseif { [matchclass $my_uri contains $::ps_rpt_crm_uris] } {
    pool ps_rpt_crm
 Application URIs
  } elseif { [matchclass $my_uri contains $::ps_hrms_uris] } {
    pool ps_hrms_ssl_prod
    set usessl 1
  } elseif { [matchclass $my_uri contains $::ps_fin_uris] } {
    pool ps_fin_ssl_prod
    set usessl 1
  } elseif { [matchclass $my_uri contains $::ps_crm_uris] } {
    pool ps_crm_ssl
    snat none
    set usessl 1
 Integration broker URIs (The IB is the SOAP integration layer)
  } elseif { [matchclass $my_uri contains $::ps_gwib_uris] } {
    pool ps_hrms_ssl_prod
    snat none
    set usessl 1
  } elseif { [matchclass $my_uri contains $::ps_gwam_uris] } {
    pool ps_fin_ssl_prod
    snat none
    set usessl 1
 Currently reject unmatched URIs, but once all applications are integrated with Portal, we will redirect to Portal homepage
  } else {
    reject
  }
when SERVER_CONNECTED {
  if { $usessl == 0 } {
    SSL::disable
    }
  }
}
No RepliesBe the first to reply