Forum Discussion

Sulabh_Srivasta's avatar
Apr 30, 2021

Help for setting policy /iRule

Hello All, I have a scenario where I have to use only one HTTPS Virtual server for multiple applications listening on different ports on different node, for example: There are 3 servers , Node_X, N...
  • Enes_Afsin_Al's avatar
    Apr 30, 2021

    Hi Sulabh Srivastana,

    Remove use command.

    when HTTP_REQUEST {
    	if { [HTTP::uri] starts_with "/core" } {
    		pool Pool_X
    	} elseif { [HTTP::uri] starts_with "/service" } {
    		pool Pool_X
    	} elseif { [HTTP::uri] starts_with "/ims" } {
    		pool Pool_X1
    	} elseif { [HTTP::uri] starts_with "/portal" } {
    		pool Pool_Y
    	} elseif { [HTTP::uri] starts_with "/ords" } {
    		pool Pool_Z
    	}
    }

    switch version:

    when HTTP_REQUEST {
    	switch -glob [HTTP::uri] {
    		"/core*" -
    		"/service*" { pool Pool_X }
    		"/ims*" { pool Pool_X1 }
    		"/portal*" { pool Pool_Y }
    		"/ords*" { pool Pool_Z }
    	}
    }

    without using pool:

    when HTTP_REQUEST {
    	switch -glob [HTTP::uri] {
    		"/core*" -
    		"/service*" { node 1.2.3.4 10004 }
    		"/ims*" { node 1.2.3.4 10009 }
    		"/portal*" { node 5.6.7.8 10006 }
    		"/ords*" { node 9.10.11.12 10008 }
    	}
    }