irule : Append String to the pool member

is this possible using irule to append string to the pool member, the request will come in to the VIP.

Can you clarify what you’re trying to accomplish (perhaps an end-to-end example)? The question seems ambiguous.

iRule:

Redirect when HTTP_REQUEST { if { ([HTTP::uri] == “/”) } { HTTP::redirect “http://[HTTP::host]/projector/api” return } }

It looks like you also want the redirect to the specific pool member, yes? There is a way to do this, but I’d first ask: why? Usually, one of the purposes of an ADC is to essentially virtualize a service endpoint. The objective is to hide the pool members, not expose them.

I dont want to send it to specific pool member, it has to load balance using RR algorithm. I want to append string “/projector/api” to the each node.

To clarify, and explain why there is a bit of confusion, it’s important to understand a few BIG-IP specific terms. In BIG-IP parlance, a Node is an IP address that is the target of a load-balancing or forwarding decision. A Pool Member is the combination of a node (IP) and target port. A Virtual Server is a virtual listener which accepts traffic, performs ADC or other (e.g., DDoS protection) functions, and possibly forwards or load-balances to one or more Pool Members (or, occasionally, Nodes).

So, when you say “append a string to each node”, that’s a bit confusing with the nomenclature above (and hence, my general confusion).

It seems that what you want is to change the uri-path to “/projector/api” if it is “/”. The iRule you have above (formatted a bit differently immediately below) should do what you desire. I did change HTTP::uri to HTTP::path because HTTP::uri may include query parameters. Is your code not working?

when HTTP_REQUEST {
    if { [HTTP::path] eq "/" } {
        HTTP::redirect "http://[HTTP::host]/projector/api" 
    }
}

Incidentally, if you are running at least 11.4.0, you should consider using a Local Traffic Policy for this function:

Its working.

Thanks.