Forum Discussion
kng_107168
Nimbostratus
Mar 02, 2011unable to redirect to a different page on another pool
This is what I have but the client browser doesn't seems to like the redirection.
when HTTP_REQUEST {
if { [active_members poolA] < 1 } {
use pool poolB
HTTP::redirect "/splash.html"
}
}
Essentially I want the HTTP::host to be the same. I don't really care of the uri, whether the user sees the splash.html or not.
Can anyone point out what I'm doing wrong please?
Thanks in advance.
Ken
- Chris_Miller
Altostratus
Yep - I was basically asking whether LTM was terminating the SSL so it could see clear text. - kng_107168
Nimbostratus
much appreciate it - hoolio
Cirrostratus
I think Chris' original example should work if the splash.html page doesn't reference any other objects on the same fully qualified domain name. HTTP_REQUEST will be triggered regardless of whether there is a pool on the virtual server or whether the pool is up.when CLIENT_ACCEPTED { Save the name of the VS default pool set default_pool [LB::server pool] } when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]" if { [active_members $default_pool] < 1 } { log local0. "[IP::client_addr]:[TCP::client_port]: No members for $default_pool. Rewriting URI to /splash.html and using poolB" pool poolB HTTP::uri /splash.html } }
when CLIENT_ACCEPTED { Save the name of the VS default pool set default_pool [LB::server pool] } when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]" if { [active_members $default_pool] < 1 || [HTTP::uri] starts_with "/maintenance/"} { log local0. "[IP::client_addr]:[TCP::client_port]: No members for $default_pool. Rewriting URI to /maintenance/splash.html and using poolB" pool poolB HTTP::uri "/maintenance/splash.html" } }
- Chris_Miller
Altostratus
Yeah, not sure what I was thinking.when CLIENT_ACCEPTED { if { [active_members poolA] < 1 } { pool poolB set maint 1 } else { set maint 0 } } when HTTP_REQUEST { if { $maint eq 1 } { HTTP::uri /splash.html } }
- Chris_Miller
Altostratus
Hah - Thanks Aaron...I assumed HTTP_REQUEST wouldn't trigger if LB_FAILED was triggered. - hoolio
Cirrostratus
If you have an HTTP profile on a VS, TMM will: - kng_107168
Nimbostratus
I tried Chris' suggestion but not working. - hoolio
Cirrostratus
When you say it doesn't work, what does the client actually receive when the URI is rewritten to /maintenance/splash.html? Have you changed the location of the splash.html page to move it to the /maintenance/ directory? - kng_107168
Nimbostratus
Yes, I have tried it putting the splash file into the maintenance directory but still not working. I think the client browser just get some sort of network reset. It never received any content of the splash page. And the splash page is just very simple html code, like hello world. - hoolio
Cirrostratus
Do you see any errors in /var/log/ltm? If not, can you run a tcpdump on LTM to see if the request is making it there?
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