Forum Discussion
Fereda_187281
Nimbostratus
Oct 27, 2015URI Translation and redirect help
Hello all;
I am using the BigIP v 11.6.
My users will in the browser put (https://abc-abc.abc.com/abc/example.asp=1) my redirect states
redirect to "https://backendserver/xyc/example.asp=1...
- Oct 27, 2015
In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{ HTTP::host "backendhostheader" } HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]] Disable the stream filter for all requests STREAM::disable LTM does not uncompress response content, so if the server has compression enabled and it cannot be disabled on the server, we can prevent the server from sending a compressed response by removing the compression offerings from the client HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { Replace http:// with https:// STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@} Enable the stream filter for this response only STREAM::enable } }
Brad_Parker_139
Nacreous
Oct 27, 2015In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{
HTTP::host "backendhostheader"
}
HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]]
Disable the stream filter for all requests
STREAM::disable
LTM does not uncompress response content, so if the server has compression enabled
and it cannot be disabled on the server, we can prevent the server from
sending a compressed response by removing the compression offerings from the client
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
Replace http:// with https://
STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@}
Enable the stream filter for this response only
STREAM::enable
}
}
- Fereda_187281Oct 27, 2015
Nimbostratus
Brad remarkeble!! It is working.But My Vip settings had not got stream check.it was selected none before so i was put the line which starts stream. Is it correct way?I think in this case te response uri include backend server hostname. So how can i hide the response? Thanks again.. - Brad_Parker_139Oct 27, 2015
Nacreous
Yes, just add the default stream profile to your VIP and un-comment the STREAM commands in response to have the response re-written to mask the backend hostname and uri. - Fereda_187281Oct 27, 2015
Nimbostratus
Hİ Brad Again; Thank you for your help it is good working:) And ask one thing WHy we are disable stream all via irule although bind it in properties menu. Whats the stream action in here? - Brad_Parker_139Oct 27, 2015
Nacreous
We have to attach a stream profile to use it in an iRule. In the iRule we disable it in the request because we don't want to rewrite contents in the HTTP payload, just the headers which we can do with the commands above. We then enable it for the response to rewrite links and resources in the HTTP payloads that are returned that contain the backend info we want to mask from the browser.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
