Forum Discussion
TMcGov_92811
Nimbostratus
Jan 31, 2014Replacing hostname in HTTP RESPONSE header using stream profile and/or Irule
We are trying to allow access from the internet into an internal webserver running on port 8010. The webserver is coded with its internal hostname (host15.mycompany.com:8010) which is only resolvable...
Kevin_Stewart
Employee
Jul 22, 2014Maybe a minor modification is in order:
when HTTP_REQUEST {
Disable the stream filter for requests
STREAM::disable
Remove this header to prevent server from compression response
HTTP::header remove Accept-Encoding
}
when HTTP_RESPONSE {
Rewrite the Location header for redirects
if { [HTTP::header exists Location] }{
HTTP::header replace Location [string map {"http://xyz.company.com:8010" "https://abc.company.com"} [HTTP::header Location]]
}
Rewrite the response content using a stream profile if it is text
if { [HTTP::header Content-Type] contains "text" } {
Set the stream expression with the find/replace strings
STREAM::expression "@xyz.company.com:8010@abc.company.com@"
Enable the stream filter
STREAM::enable
}
}
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