Forum Discussion
Remove URI on sorry server page
I have a very simple irule that just directs traffic to a sorry server pool if there are no pool members available for the requested pool. I also initially remove any URI to ensure that links with URIs see the maintenance page. I would like to configure a rule that does this exact same thing but removes the URI every time. For example when I goto amazon.com/test I see a sorry page in the same session if I add 123 to the end of the uri I still see the same sorry page. In my rule I initially see the sorry page but if I add anything to the uri I get a browser 404 page.
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
HTTP::uri /
pool /ESI/solr.erp-pool
}
}
17 Replies
- nitass_89166
Noctilucent
In my rule I initially see the sorry page but if I add anything to the uri I get a browser 404 page.
can you try to add oneconnect profile?
- pgsmith_120398
Altostratus
I added a oneconnect profile to the VS that im testing with and it now does not remove the URI at all. http://site/anything returns a browser 404 page. - nitass_89166
Noctilucent
is if-condition indeed triggered? - pgsmith_120398
Altostratus
sorry nitass I neglected to place my host file back into the drivers\etc folder... it does work however the sorry page has lost most of its formatting, mostly images. Also I assume we would have to enable oneconnect on every VS that uses the sorry server irule. This wont be possible as we've determined some applications that use the irule do not function properly with oneconnect.
- nitass
Employee
In my rule I initially see the sorry page but if I add anything to the uri I get a browser 404 page.
can you try to add oneconnect profile?
- pgsmith_120398
Altostratus
I added a oneconnect profile to the VS that im testing with and it now does not remove the URI at all. http://site/anything returns a browser 404 page. - nitass
Employee
is if-condition indeed triggered? - pgsmith_120398
Altostratus
sorry nitass I neglected to place my host file back into the drivers\etc folder... it does work however the sorry page has lost most of its formatting, mostly images. Also I assume we would have to enable oneconnect on every VS that uses the sorry server irule. This wont be possible as we've determined some applications that use the irule do not function properly with oneconnect.
- Richard__HarlanHistoric F5 Account
Amazon is displaying a custom 404 page so any page that is not found gets the customer error. You can do this on your server by changing the 404 page the server send back. You can also do this at the f5. If the status code from the server is a 404. You can host the error page on the f5 instead of sending it to a pool of server. Doing this will allow you to send the same page for 500/400 and server down errors. The following link will walk you through the process.
https://devcentral.f5.com/articles/hosting-sorry-error-or-maintenance-pages-on-big-ip-ltm-with-irules.UmFPRRD4KSo
- pgsmith_120398
Altostratus
Hey Richard, I have a pair of IIS servers configured with the default website binding of *. The default site serves up a custom sorry page and there are dozens of other customized error pages that are bound to their sites URL. This works fine as long as there is no URI. To get around this I remove the URI in my rule. We would prefer the users not get a 404 at all and instead be redirected to the appropriate sorry server page. I initially tried to go the route of hosting the sorry pages on the LTM but we eventually decided not to so we didn't have to give the web developers access to the F5 to update the maintenance pages. There was probably a more intricate route we could have taken but we decided hosting two VMs to use as sorry servers was sufficient with the time we had to set this all up. - Richard__HarlanHistoric F5 AccountSo if there is no URI the website server the default webpage, which works well. But if you add the URI the server returns the 404 page correct?
- pgsmith_120398
Altostratus
correct. On the IIS side even when the binding for the default page is set to * if there is any URI it will return a 404.
- Richard__HarlanHistoric F5 Account
Do you get the same problem going to the web server directly instead of going through the f5? If so I am guessing there is something in the IIS config.
- pgsmith_120398
Altostratus
Yes this is an IIS issue not an F5 issue. I was able to pretty easily resolve it with the use of my existing iRule so I thought maybe I could just add something simple to the iRule and fix it. I'm investigating using the IIS URL Rewrite module to remove the URI for incoming requests. If I figure it out on the IIS side ill update here. In the meantime I would still like to know if its possible to remove the URI every time traffic is sent through the LTM.
- pgsmith_120398
Altostratus
I was able to use the IIS URL Rewrite tool to accomplish this. I removed the uri line from my irule. the rule I used in URL Rewrite was:
Matches the Pattern Wildcards Pattern: * Rewrite Rewrite URL: /
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