Forum Discussion
8 Replies
- nitassEmployee
please guide on how to combine these two rules?
since their actions do not conflict, you can just combine them (to one HTTP_REQUEST).
- Amol_Khatavkar_Nimbostratus
I guess this will work
ltm rule uri_pool_select { when HTTP_REQUEST { HTTP::header insert X-Forwarded-For [IP::remote_addr] and { set uri [string tolower [HTTP::uri]] switch -aaaa $uri { /bbbb* - /cccc* { pool wxyz.com } default { pool default.com } } } }
Please guide me on the above configuration.
- nitassEmployee
e.g.
when HTTP_REQUEST { HTTP::header insert X-Forwarded-For [IP::remote_addr] set uri [string tolower [HTTP::uri]] switch -glob $uri { /bbbb* - /cccc* { pool wxyz.com } default { pool default.com } } }
- Amol_Khatavkar_Nimbostratus
Hi Nitass,
Thanks and for your input.Can you confirm if this will work with AND operator also as below?
ltm rule uri_pool_select { when HTTP_REQUEST { HTTP::header insert X-Forwarded-For [IP::remote_addr] and { set uri [string tolower [HTTP::uri]] switch -aaaa $uri { /bbbb* - /cccc* { pool wxyz.com } default { pool default.com } } } } }
Thank again.
- nitassEmployeeno, it won't work.
- Amol_Khatavkar_Nimbostratus
Hi Nitass,
Thanks for your response.
Can you tell me the difference between below two lines,
HTTP::header insert X-Forwarded-For [IP::remote_addr]
HTTP::header insert WL-Proxy-Client-IP [IP::client_addr]
Thanks again.
- nitassEmployee
Can you tell me the difference between below two lines
Returns the IP address of the host on the far end of the connection. In the clientside context, this is the client IP address. In the serverside context this is the node IP address. You can also specify the IP::client_addr and IP::server_addr commands, respectively.
IP::remote_addr
https://devcentral.f5.com/wiki/iRules.IP__remote_addr.ashx - Mahmoud_Eldeeb_Cirrostratus
combine both to one HTTP_REQUEST