Forum Discussion
Adding Port translation from 8080 to 80 in the existing iRule.
Hi All,
Need an help to refine the existing iRule for a port translation.
when HTTP_REQUEST {
log local0. "Request HOST is [HTTP::host] URI is [HTTP::uri]"
if {[string tolower [HTTP::host]] starts_with "www.mywebsite.com"}
{
switch -glob [string tolower [HTTP::uri]] {
"/seatrans*" { pool Sea_trans }
"/emarine*" { pool Emarine }
"/intranet/*" { pool intranet }
"/pts*" { pool PTS }
"/foundry*" { pool ifoundry }
"/omni*" { pool Omnidocs }
"/engg*" { pool Eproperty }
"/codes*" { pool CODESK }
"/ipcm*" { pool RSA-iPLCMS-HTTPS }
"/*" { pool HTTP-www.mywebsite.com }
}
}In the above code only /seatrans page once it is accessed and filled its form data and submitted by clicking Submit button, the data will be carried with the following URL http://www.mywebsite.com:8080/setrans/GetTransValues.asmx will be returned to F5 from the client. Now how to convert the port in the header from 8080 to 80 before sending it to the pool member? Is that can be achieved with iRule or any other options available.
Please let me know. Thank you in advance!
1 Reply
- Kevin_Stewart
Employee
You can do a string map:
when HTTP_REQUEST { HTTP::header replace Host [string map {":8080" ""} [HTTP::header Host]] }Since you're changing it to 80 (a standard HTTP port), you probably don't need to send it to the server, so I'm just removing :8080 from the Host header.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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