Forum Discussion

tvotta_94824's avatar
tvotta_94824
Icon for Nimbostratus rankNimbostratus
Oct 01, 2012

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