Forum Discussion
Chuck_13207
Nimbostratus
Aug 10, 2012Problem figuring out how to rewite what is sent to pool
I have a link that I want to be minus a directory when it is sent to the pool.n/tr1/W.aspx?L=Nb8PMkMI need to remove the dir /tr1/ when it gets sent back to the pool./W.aspx?L=Nb8PMkMI am sorry, i am new to TCL scripting and iRules so I need some helpThanks
The issue is this:
The user clicks on a link like this:
https://fqd
5 Replies
- Brian_69413
Nimbostratus
I was thinking about something like this, but it is for the simplest case and is not tested:when HTTP_REQUEST { set pathvar [HTTP::path] string map {"/tr1" ""} $pathvar HTTP::path $pathvar }
There is a lot to consider though...
-Would /tr1 show up anywhere else in a URL that is valid?
-Should the user see the new path in their address bar or not?
-Do we need to do this for every case or should there be some logic?
Hope that helps... - Chuck_13207
Nimbostratus
Sorry, I have been out on vacation for the weekend. Thanks for responding.
We have 2 servers on the backend that can generate an URL. By default it looks like this; https://server.ip/W.aspx?9293430
Both generate the same format as well you can put anything between the https:// and the /W.aspx?. I wanted to have it generate something like this; https://FQDN/tr1/W.aspx?23kd93 and https://FQDN/tr2/W.aspx?234f3234
That way I can tell which URLs are coming from which server. On the front end, it looks like the above, and depending on the dir (/tr1/ or /tr2/) I will send it to that pool, strip off the dir and just give it the ./W.aspx? to that server to retrieve the image and pass it back to the client.
I hope this makes sense.
Thanks - Brian_69413
Nimbostratus
OK, how about this:when HTTP_REQUEST { set pathvar [HTTP::path] if { [HTTP::path] contains "/tr1" }{ string map {"/tr1" ""} $pathvar HTTP::path $pathvar pool pool_tr1 } elseif { [HTTP::path] contains "/tr2" }{ string map {"/tr2" ""} $pathvar HTTP::path $pathvar pool pool_tr2 } } - Chuck_13207
Nimbostratus
Can I send you the irule we currently have so you can see what is currently being used and maybe you can see how this needs to work? - hoolio
Cirrostratus
Hi Chuck,
You could post an anonymized copy of the iRule to get feedback.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
