Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Performing redirect in function of host

jpicazo
Nimbostratus
Nimbostratus

I am configuring an access pilcy and in my end point I need to do one redirection or another depending on the host of the request that I receive

I've tried to do the following 

 

jpicazo_0-1665068808274.png

En mi macro I check If my host is hosts 

jpicazo_1-1665068919904.png

If not I go to hte fallback to other redirect

 

This macro is part of this other

jpicazo_2-1665069092439.png

Could you tell me if this will work finew and if the regular expresion is correct

1 REPLY 1

Have you tested it ? This is the best way to find if something is not working.

 

After that you can just try the "ACCESS_POLICY_AGENT_EVENT" to trigger an irule event. First you may need to save the HTTP::host to a variable in the "HTTP_REQUEST" event as I do not renember if the HTTP::host can be used directly in the "ACCESS_POLICY_AGENT_EVENT"  but testing this will tell you the answer.

 

https://clouddocs.f5.com/api/irules/HTTP__host.html

https://clouddocs.f5.com/api/irules/ACCESS_POLICY_AGENT_EVENT.html

https://clouddocs.f5.com/api/irules/ACCESS__policy.html

 

 

Also this post is nice as it seems like your usercase, so sometimes when you google for previous posts you will find answer even without asking:

 

https://community.f5.com/t5/technical-forum/apm-policy-based-on-http-host-header/td-p/206460