Forum Discussion
John_Lennon_457
Nimbostratus
Mar 26, 2010Redirecting with ProxyPass V10
(reposting as unsuccessful before)
I'm using ProxyPass V10 to dynamically select among a dozen different pools and redirect the traffic to different applications based on the URL. Some of these apps are in beta and are being developed / changed so it may happen that:
1. some .js or images may not be there, which would return a 404
2. a link on a page may be wrong which would return an error 404 or 501, depending on the case.
The error 404 for the 1st case while not ideal aren't so bad as the user doesn't really see them: the browser handles this gracefully as the page loads fine otherwise.
The 2nd one is an issue. I would like to redirect to an error page instead of showing the error to the end user. It should be possible for an error like 500, but how do I handle the two different scenarios for a 404 (whole page vs an element of the page)?
My goal would be to redirect to a common error page (yes some servers may handle the error gracefully but the 500 is still a sever error and wouldn't help much if the server itself is having a serious problem). For now I use this simple code, but ideally I'd like to be able to capture the URI too, not sure if it's possible in a response:
when HTTP_RESPONSE {
if { [HTTP::status] >= "400" } {
log local0.error "*** User IP: [IP::client_addr] - HTTP Status: [HTTP::status] - server IP: [IP::server_addr]"
}
if { [HTTP::status] >= "500" } {
HTTP::redirect "https://greenhouse.lotus.com/errorpage/error_gh.html"
}
}
3. I'd also like to redirect any request for favicon.ico (which I see coming in www.mysite.com/favicon.ico or even www.mysite.com/some/thing/favicon.ico to a specific one with a specific one but I can't find a way with ProxyPass to specify this as it looks like ProxyPass handles directory redirections and doesn't implement a single file redirection to a specific file.
4. Is there a way to redirect all traffic that would go to a pool to a static page if, for example, I take down all members of the pool for an upgrade? I'd like to avoid modifying all the ProxyPassMySite file as this is error prone - I'd rather have an automatic way, which would help in case a pool with just one server goes down (crash, hardware failure, etc.).
Thank you in advance for any help.
No RepliesBe the first to reply
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