Proxypass with LTM policy

Hello,

Can we make a proxypass with the ltm policy? I want to delete a pattern of a URL between the url called by the client and the url received by the server, for example: Client calls the URL https://mydomain.net/env1/index.php Serveur receive the URL https://mydomain.net/index.php

When I use the following condition: Operand: http-uri Event: request Selector: path Condition: contains Value: env1

And the following actions: Target: http-uri Event: request Action: replace Parameters - Name: Path Value: /

It replace all the path /env1/index.php with / so I want to keep /index.php.

How can I do that with LTM policy?

If there is a way to do that in LTM policies, I don’t know of it. LTM policies don’t typically support that level of granularity, but iRules do. Here is an iRule that I believe will solve your issue.

when HTTP_REQUEST
{
    if{[string tolower [HTTP::uri]] starts_with "/env1/index.php"} 
    {
        HTTP::uri "/index.php"
    }
}