MohanK
Apr 21, 2021Altostratus
Reverse Proxy using Cookie in iRule or Policy
Hello,
We need to add below irules/policy for google cloud reverse proxy:
1. The application will drop a cookie on the first request of https://abc.site.com
2. The LTM needs to detect this cookie when it intercepts the request. based on the cookie the request needs to be reverse proxy to a google cloud URL without changing the actual application URL.
Example:
Cookie name: Experience.
1. If the cookie exist:
abc.site.com -> def.site.com/home
Note: the URL in the browser should still be https://abc.site.com
2. If the cookie doesn't exist
https://abc.site.com no changes
Create a pool for Google Cloud destination. Modify iRule with pool name accordingly.
when HTTP_REQUEST { if { ( [HTTP::cookie exists Experience] ) } { HTTP::header replace "Host" "def.site.com" HTTP::uri /home pool def.site.com_pool } else { return } }