Forum Discussion
How do I create an irule that rewrites a request to be translated to an ipaddress and port
An HTTP request (and response) has different parts. For example:
GET /elasticsearch HTTP/1.1
Host: 192.156.202.22
User-Agent: Mozilla...
Accept: */*
In the above example HTTP request:
- "GET" is the HTTP method
- "/elasticsearch" is the HTTP URI
- "HTTP/1.1" is the HTTP version
- "Host: 192.156.202.22" (and everything below this) is an HTTP header
The direct connect to the server use the member address and the port in the reqest
When you use non-standard ports to access HTTP resources, a user agent will typically include this port number in the Host header. That does not necessarily, however, mean that the server needs or cares about this value in the Host header. While there are rare cases in which it's needed, it could very well be that the server ignores this value altogether.
This is the request type.. You are leaveing of the /elasitcsearc prt from the request
The "/elasticsearch" string is an HTTP URI value. It would NEVER be included in the HTTP Host header. So if you need an incoming request for "/" to be translated to "/elasticsearch", then:
if { [HTTP::uri] equals "/" } {
HTTP::uri "/elasticsearch"
}
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
