Forum Discussion
Dhruwal_Patel_2
Nimbostratus
Mar 23, 2007Need help for url rewrite
Hello,
I am new to iRule, so i need to clear some doubts if any one can help.
We have a scenario:
We have 2 web servers for which bigip will be balancing.
Thing...
Mar 26, 2007
First of all, if you are running SSL, then to manipulate the HTTP traffic, you will have to be terminating the SSL on the BIG-IP (otherwise there is no way to inspect the contents of the payload).
1) when a request comes like:
https://www.payment.business.com/product/$1
Then Bigip should modify that and send to webserver in this format
http://www.transaction.com/$1
Assuming you are terminating the SSL, then you can easily remove sections of a string with the "string map" command.
when HTTP_REQUEST {
The [string map ...] command will replace all occurrances
of "/product" in the original HTTP::uri with an empty string
The containing HTTP::uri command sets the URI to this new value.
HTTP::uri [string map { "/product" "" } [HTTP::uri]]
}
Once the webserver receives this url, it will do some process and return the url like:
http://www.transaction.com/business/$1
Now BIGIP should remodify it before sending it to the browser who requested as follows:
https://www.payment.business.com/product/$1
I'm assuming by this you mean that embedded links in the returned content start with "http://www.transaction.com/business". There is nothing in the HTTP spec that allows a webserver to return a URL as part of the protocol. The URI is part of the HTTP Request, not the Response.
If you do want to change all embedded links, there are several examples in the iRules CodeShare section of the wiki. The Social Security and Credit Card Scrubber examples are good places to start.
http://devcentral.f5.com/wiki/default.aspx/iRules/CodeShare.html
Click hereAlso i am worried about, what if many users access this url at same time, then will bigip manages all the rewrite sessions?
This is not something to worry about. The iRules engine acts on each connection separately so there is not an issue of multiple clients causing overwrites on separate client connections.
-Joe
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