Forum Discussion
yunan_haris_123
Jan 21, 2016Altostratus
irule for change the url and port
dear all
i have customer who had proxy before, and the ideas is change the function of the proxy. unfortunately i think we must use irule to do that. here are the requirement :
we need t...
Stanislas_Piro2
Jan 22, 2016Cumulonimbus
Did you try to find if the application server provide a solution to reply with the expected urls?
Most of application servers include the ability to define http proxy parameters:
I already did it with :
- tomcat (proxy host / proxy port)
- webspere (trusthostheaderport = true + com.ibm.ws.webcontainer.extractHostHeaderPort = true)
- drupal
- sharepoint (Alternate acess mapping)
With these applications, changing request headers (X-Forwarded-proto, Host, ...) permit to not rewrite responses.
Another solution is to use a rewrite profile (since version 11.4) and define :
- direction : response
- client side url:
- server side url:
This solution will not rewrite excel content.
The last solution with irule is:
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://abc.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 "@http://abc.company.com:8010@https://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