Was this article helpful?
21 Comments
- dragonflymrCirrostratus
Hi,
 
Check ProxyPass (https://devcentral.f5.com/s/articles/proxypass-v10-v11), you will find good example of such feature.
 
Piotr
 
- Reddy1Altostratus
Sure
- Reddy1Altostratus
Can this works?
if [matchclass [HTTP::uri] equal REDIRECT] { set uri [matchclass -value [HTTP::uri] equals REDIRECT] HTTP::uri $uri pool MY_Pool }
Note:- example the data-group has entry , string:/x/y value:/z
- Stanislas_Piro2Cumulonimbus
REddy : some curly brackets are missing
you can use this code
if {[set [matchclass -value [HTTP::uri] equals REWRITE]] ne ""} { HTTP::uri $uri pool MY_Pool }
- dragonflymrCirrostratus
Hi,
@Stanislass: Is it not advised to use
instead ofclass match
?matchclass
This code is good, but I still think that it is worth checking ProxyPass and use it as base to create iRule resolving not only URI modification but as well pool selection via Data Group.
Piotr
- Stanislas_Piro2Cumulonimbus
Your right, I did not see this!
URI rewriting is never a good idea, because one consequence is response rewriting may be required. And response rewriting is the worst configuration...
- dragonflymrCirrostratus
Well, I know your approach :-), still as fast remedy I had to work figure out how to create what I need based on ProxyPass - seem to be working quite OK at least at header and cookie rewriting for responses.
Piotr
- jmolchin_47123Nimbostratus
Is it possible to reverse proxy a VS that is using a datagroup to redirect URL's? I don't want clients to proxy behind an F5 interface not access the URL directly. The VS is not using a default pool, the clients destination is in the datagroup.
- Reddy1Altostratus
For some reason the below irule not working, if {[class match $uri eq DATAGROUP]} { set new_uri [class match -value $old_uri eq DATAGROUP] HTTP::uri "$new_uri" pool $XYZ }
I need to verify the incomming uri checked against the Data-group before the value is assigned. Do i need to change it to set new_uri "[class match -value $old_uri eq DATAGROUP]" ?
- dragonflymrCirrostratus
Hi,
Assuming that you using
in$uri
and then useif
inside this will not work, so I suggest something like that:$old_uri
if ( [set new_uri [class match -value [HTTP::uri] eq DATAGROUP]] ne ""} { HTTP::uri "$new_uri" pool $XYZ }
It is assuming that your DG is set like that: old_uri := new_uri
- old_uri - key name you use to match with DG
- new_uri - new URI that should be set if there is match on old_uri
Piotr