Forum Discussion

pgsmith_120398's avatar
pgsmith_120398
Icon for Nimbostratus rankNimbostratus
Oct 18, 2013

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

  • 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's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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.
    • pgsmith_120398's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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.
  • 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's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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.
    • pgsmith_120398's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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__Harlan's avatar
    Richard__Harlan
    Historic 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's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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__Harlan's avatar
      Richard__Harlan
      Historic F5 Account
      So 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's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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__Harlan's avatar
    Richard__Harlan
    Historic 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's avatar
      pgsmith_120398
      Icon for Nimbostratus rankNimbostratus
      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.
  • 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: /