Forum Discussion
tvotta_94824
Nimbostratus
Oct 01, 2012Rewrite rule forward to specific domain and port
Hello Guys/Gals -- I'm new to irules and am trying to figure out a re-write scenario, I'm trying to change a current rule that does a redirect, and change it to rewrite. The current rule is lik...
tvotta_94824
Nimbostratus
Oct 02, 2012i have a an alias in dns to handle that translation and that appears to be working.
I added the log statements (thanks for that) and it appears that the header is not getting re-written. the log reports this:
Oct 2 15:26:17 local/tmm3 info tmm3[5303]: Rule portral-dev : changing uri to /Portal/index.html
Oct 2 15:26:17 local/tmm3 info tmm3[5303]: Rule portral-dev : incoming host header = abc-news.east.foo.com
Oct 2 15:26:17 local/tmm3 info tmm3[5303]: Rule portral-dev : incoming host header = abc-news.east.foo.com
Oct 2 15:26:17 local/tmm1 info tmm1[5301]: Rule portral-dev : incoming host header = abc-news.east.foo.com
Oct 2 15:26:17 local/tmm2 info tmm2[5302]: Rule portral-dev : incoming host header = abc-news.east.foo.com
abc-news.east.foo.com this does not seem to be getting re-written to server.nbc-news.west.foo.com:7012
I'm using this rule:
when HTTP_REQUEST {
log local0. "uri = [HTTP::uri]"
if { [HTTP::uri] equals "/" } {
log local0. "changing uri to /Portal/index.html"
HTTP::uri "/Portal/index.html"
}
log local0. "incoming host header = [HTTP::header Host]"
HTTP::header replace Host "server.nbc-news.west.foo.com:7012"
}
Any Ideas ? Thought that the "header replace Host" would do it but it seem like it's not
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