Forum Discussion
How do I create an irule that rewrites a request to be translated to an ipaddress and port
Understood, and as I mentioned before, address and/or port translation happen automatically via the virtual server configuration. It doesn't appear that you want to alter the destination address, so you'll probably want to disable address translation in the VIP, but since the VIP is listening on port 80 and the pool members are listening on port 9200, you'll want port translation enabled. The only other aspect of this, which I'm not too terribly clear on, is whether or not the server needs to see the port in the Host header. It's somewhat rare these days that this would be required, but otherwise:
when HTTP_REQUEST {
if { not ( [HTTP::header Host] ends_with ":9200" ) } {
HTTP::header replace Host "[HTTP::header Host]:9200"
}
}
This will change the incoming Host header from "192.156.202.22" to "192.156.202.22:9200".
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
