Forum Discussion
Rewrite 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 like this, it works but of course the browser url gets updated and we want to keep the destination from displaying.
=================================================================================================== when HTTP_REQUEST { if { [string tolower [HTTP::host]] starts_with "abc-news.east.foo.com" } { HTTP::redirect "https://server.nbc-news.west.foo.com:7012/Portal/index.html" } } ===================================================================================================
I Attempted the following re-writes but browser hangs. I'm trying to forward to a specific domain and server that is listening on a specific port.
when HTTP_REQUEST { if { ([HTTP::host] eq "abc-news.east.foo.com") && ([HTTP::uri] eq "" } { HTTP::header replace "Host" "https://server.nbc-news.west.foo.com:7012" HTTP::uri "/Portal/index.html" } }
================================================================================
when HTTP_REQUEST { if { ([HTTP::host] eq "abc-news.east.foo.com")} { HTTP::header replace "Host" "https://server.nbc-news.west.foo.com:7012"} { HTTP::uri "/Portal/index.html" } }
Wondering if I might need to use a pool member to redirect, so I created a pool that has it service port going to 7012. It appears to be listening OK as it green. So my question is how can I rewrite to go to that pool or am I going about this the wring way. I'm not finding much about rewrite using a port.
Thanks
T
21 Replies
- nitass
Employee
should you need additional rewriting besides from / to /Portal/index.html (since i do see http 404 status in the log)?
by the way, http analyzer tool such as httpwatch, httpfox may be helpful to see what is going on when accessing application directly.
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
