Forum Discussion

Alan_Stevens_93's avatar
Alan_Stevens_93
Icon for Nimbostratus rankNimbostratus
Dec 04, 2008

Default Document not displaying in IIS

Hi all,

 

 

new to the big IP admin side of things so bear with me.

 

 

We have 2 IIS6 nodes serving up static content behind a big IP virtual. There are no iRules or profiles in place for this load balanced setup. The pool is using gateway_icmp for a health monitor. The send string is GET / no return strung.

 

 

here is what my problem is:

 

 

a user can go to http://www.sitename.com and is served the default document. A user can go to http://www.sitename.com/support/ and is served the default document. However, if a user tries to go to http://www.sitename/support - without the trailing /, the session times out on 404. If I go local to the server, I can have the page delivered with either method.

 

 

Is there a configuration change that can be made to allow the Big IP to pass the request correctly? Or perhaps an iRule?

 

 

Thanks for the help.

6 Replies

  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    This sounds like the ol' trailing slash problem, which has been a bane of webmasters for years.

     

     

    Take a look at these threads:

     

     

    https://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=12294&view=topic

     

    https://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=4112&view=topic

     

     

    ...which show some iRules that can help.
  • Thanks for that train of thought. This rule:

     

     

    when HTTP_REQUEST {

     

    set uri [HTTP::uri] if { ! ( $uri ends_with "/" ) } { append uri "/" HTTP::uri $uri }}

     

     

    seems a bit bruteish though, as it will append the / to ANY uri stream. I have some other iRules in place on this virtual that would probalby not like this too much. Specifically, some redirect rules that are sorting by trailing /blah. If I am understanding this correctly, that would then make -/blah- change to -/blah/- which would break the redirect?
  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    I read that iRule to say "for all URIs that do not already end in '/', append a '/'". This would include any final files as part of the URI string, so yeah, it's a bit heavy-handed.

     

     

    If that casts too wide a net, you might create a data group of URIs that are to be fixed with a trailing slash, and then reference that in the iRule.

     

     

    (Though that's not to say that there may be a better, easier way as well...there almost always is).
  • I'd try investigating what exactly is failing before taking the sledgehammer approach of trying to modify the requested path in an iRule. I'm not sure why you'd get a failure if all you're doing currently is accepting an HTTP request and load balancing to an HTTP server.

     

     

    You can use a browser plugin like HttpFox or LiveHttpHeaders for FF or Fiddler for IE to see what the exact request and response headers/bodies.

     

     

    Aaron
  • Thanks for the help guys. A question I haven't been able to find an answer to is this: is there a generic http rule that you should put in place on any virtual to handle traffic? somethign like this?

     

     

    when HTTP_REQUEST{

     

    if [HTTP:uri] equals ""} {

     

    HTTP::uri}

     

     

    Or is this handled automatically?

     

  • A URI should never be null--it's not valid. If a user enters www.example.com in a browser, the browser must append a trailing slash and the protocol: http://www.example.com/. The URI for this request would then be /. So no rule is necessary to ensure the client doesn't make a request with a null URI.

     

     

    Aaron