Mark Ferraz

All MindsharpBlogs

My Links

Archives

Image Galleries

Blog Stats

Mark's Links

F5 and SharePoint HTTP to HTTPS Redirect "Gotcha"

Let's assume that you have a medium sized SharePoint Server 2007 farm with two WFEs behind an F5 “BIG IP” LTM.

The host name for each configured web application resolves to the Virtual IP (VIP) on the F5, which in turn performs it's sophisticated load balancing function and routes the traffic to one of the two designated WFEs for processing.

Naturally, you would visited F5's web site and followed this deployment guide when creating your configuration profile and HTTP pool. And would assume that all is well, right? Well, mostly, but maybe not...

During testing, you begin to notice that some requests are getting dumped on the HTTP response, which is causing the browser to provide a 404 error. After some investigation, you realize that this abnormality only occurs under very specific, yet obscure, conditions. In my case, I had a custom SharePoint feature which included a WebContol which was loading as a CustomAction in the document library list ViewToolbar. This WebControl performed some configuration settings adjustments similar to those described in my post entitled “Using a Delegate Control Feature to Reconfigure OOTB Site Definitions“. Upon completing the execution of the changes included in my class, I tagged the list to avoid future re-execution of that passage, and performed a page redirect to reload the page so the user would see the new settings.

This is where things got very interesting...

It turns out that I only had the browser 404 when the request traffic was flowing through the F5 LTM. If I set a local host entry on the client, my WebControl would do it's work, reload the page, and everything was just fine. Even more perplexing was the fact that with the custom feature de-activated, initial list library loads flowing through the F5 occurred without error as well. Very strange indeed...

So, a few fine colleagues and I began the lengthy process of sniffing the traffic using Net Mon on both the client and the server in order to find out exactly what was happening. What we found was both slightly confusing, and very unexpected. To set this up, let's go back to the F5 Deployment guide I referenced earlier. In section 1-8, the guide lays out the steps for creating the HTTP pool. Step 6 states:

6. In the Settings section, check the Custom box for Redirect Rewrite, and from the Redirect Rewrite list, select Matching.

Well, it turns out that Redirect Rewrite is an interesting little feature indeed. SOL9612 on the F5 support site (requires registration) describes the specifics of this setting, which is so quickly passed over in the deployment guide it isn't even funny.

Basically, when a requested URI does not include a trailing slash (a forward slash, such as /, at the end of the URI), some web servers generate a courtesy redirect. That sounds like an OK thing, right? Sure, but guess what, and this is the “Gottcha“...

In BIG-IP LTM version 9.x you can configure an HTTP profile to rewrite URLs so that redirects from an HTTP server specify the HTTPS protocol.

Whoa, what just a minute! That doesn't even sound like the same feature. how did we go from slashes to protocol redirection. Hmmmm.... As it turns out, the Redirect Rewrite options available are as follows:

  • Choose All to rewrite any HTTP 301, 302, 303, 305, or 307 redirects to HTTPS

  • Choose Matching to rewrite redirects when the path and query URI components of the request and the redirect are identical (except for the trailing slash)

  • Choose Node to rewrite redirects when the redirect URI contains a node IP address instead of a host name, and you want the system to change it to the virtual server address

So, basically, if we follow the settings recommendations included within the deployment guide referenced above, we inadvertently setup the F5 in such a way that any redirect with a matching referrer, such as the one I had placed in my WebControl, will cause the HTTP response coming from the WFE to be rewritten by the F5 as an HTTPS response... as a courtesy, of course :)

Ok, back to the deployment guide one more time... Above the step by step in section 1-8, there is a short disclaimer as well as a note written in italics. These state the following:

Important: If you are using the WebAccelerator module, we recommend you configure an HTTP profile based off of the default HTTP profile, and only change the Redirect Rewrite option to Match. Any other settings in this case are optional.

-and-

The following procedure shows one way to optimize the Microsoft SharePoint 2007 configuration that has been tested in real-world scenarios by F5, and shown to give the greatest improvement. These  procedures and the specific values given in some steps should be used as guidelines, modify them as applicable to your configuration.

So, what the fine print is really saying here is:

  1. If we are using the WebAccelerator module, we should NOT set the Redirect Rewrite options to Matching, but rather set it to Match, which interestingly enough is not a listed option in the above referenced support article on the F5 support site, nor (as is the case with all the options for this setting) is it listed or explained anywhere in the deployment guide.
  2. These settings, including step 6, and their specific recommended values should be used (only) as guidelines, and may require modification in your environment.

Well, in the case of a SharePoint implementation, while I can see some value in the whole trailing slash detection thing, I can't see many cases where I would want HTTP traffic being converted into HTTPS traffic, at least not in this case. Upon changing the Redirect Rewrite setting to None, everything works fine again and the browser errors disappear (magic!).

On a side note, I think it is worth mentioning that if you are doing development of custom components for your SharePoint implementation, and you plan on using an F5 LTM, you might want to avoid performing redirects, especially in cases where you are simply trying to reload the current page for the user. Although, hopefully you find this post first, and simply adjust the settings to resolve the issue entirely.

-Mark

Please feel free to send any thoughts, comments, or questions to mark@solutionsmark.com

posted on Friday, March 14, 2008 2:06 AM

Feedback

# re: F5 and SharePoint HTTP to HTTPS Redirect "Gotcha" 6/20/2008 12:09 PM bedava oyunlar

great test

# re: F5 and SharePoint HTTP to HTTPS Redirect "Gotcha" 7/18/2008 9:08 AM feklos

The effects of the psychic force’s release, however, are too much for Tetsuo to handle, who slowly goes mad as his powers increase. Unable to tolerate his imprisonment and be experimented on, Tetsuo flees the lab.

The Colonel, who recently imposed a military manga takeover of the government after an unsuccessful attempt to strip him of his authority, pursues Tetsuo. The Colonel intends to use Tetsuo to increase his martial rule.
http://karkode.com/index.php?id=88
http://sig-ment.com/index.php?id=13
http://karkode.com/index.php?id=195
Meanwhile, a separate faction, of which the agent Kay is part of, is trying to sabotage the AKIRA project to prevent a repeat of the destruction of 30 years ago. Kaneda becomes involved with Kay in his search for his lost friend Tetsuo.

With the Colonel and Kay waiting in the wings

# re: F5 and SharePoint HTTP to HTTPS Redirect "Gotcha" 7/18/2008 9:08 AM pjaterka

While each character has a level of importance to weaving the story together into its final outcome, the main characters are the doomed teenage delinquent Tetsuo and his one-time mentor, the equally delinquent Kaneda. Tetsuo is part of the biker gang led by Kaneda. The small-framed Tetsuo is taken lightly by Kaneda and the other members of the bike group. http://sig-ment.com/index.php?id=46
http://pjaterka.com/index.php?id=151
http://alfastok.com/index.php?id=165 Diminutive and weak, he hasn’t proven himself as an equal, in the mind of Kaneda.

In an effort to improve his status in the gang, Tetsuo hentai races ahead of Kaneda and the others while chasing one of the members of their rival biker gang, the clowns. He winds up accidentally crashing into a psychic child escapee, Takashi, from the scientific lab reinvestigating the AKIRA project.

Tetsuo is then taken by the military, led by the Colonel, to the lab for analysis himself. At the lab, it is discovered that the contact Tetsuo had with Takashi, also known as number 26, has unleashed psychic powers in Tetsuo that had previously been seen in only in Akira himself, number 28.

# ann 9/22/2008 1:51 AM yunfeiyang

jh592mx Welcome to <a href="http://www.powerleveling-wowgold.com/">wow gold</a> site, the purchase of <a href="http://www.wow-powerleveling-wow.com/">wow gold</a> ensure that the Lutheran Church <a href="http://www.cheapestwowgold.org/">wow gold</a> a good site

# re: F5 and SharePoint HTTP to HTTPS Redirect "Gotcha" 10/11/2008 2:15 AM ed hardy

I need Thank you!

Title  
Name  
Url
CAPTCHA
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments