Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question has it's roots in a SharePoint site that I am help with.

Background on the issue I dealt with:

The dev box and integration server are not setup behind a load balancer. The links were being built using the HttpRequest.Url value from the current context. Note that the links weren't relative links but full URIs. Once we deployed to testing (which has a LB, amongst other things) we received errors on the links being built since the server had an address of "" while the address at the LB as "" (SSL was off-loaded at the LB). The fix was easy enough by using relative URIs.

The Question:

Since this is the first site I've worked with that's behind a Load Balancer on I'm wondering if there are other gotcha's that I need to consider when developing a site behind one?

share|improve this question
up vote 1 down vote accepted

First, you need to have a good way to switch between HTTP and HTTPS, depending on the application need. To solve this problem, we have an auto-configuration script that detects the location of the application and generates constants (such as URL_SECURE, URL_STANDARD) accordingly.

Secondly, the "stickiness" of your LB configuration can be very important to not losing sessions. All requests from a given client must be routed to the same back-end server, unless you have fully shared session handling in place.

What happened to me once (very frustrating) was that when the user switched to HTTP from HTTPS for bulk data download, this skipped outside of the "stickiness" definition for the LB, and occasionally that user would end up on Server #2, losing their session, and getting redirected to the login page.

(that was with a Cisco CSS 11501)

Hope this helps a bit.

share|improve this answer
interesting, so I guess the moral of the story (as it were) is LB = shared session handling. (Yet another reason to avoid using Session data if possible.) – Ken Henderson Feb 5 '11 at 4:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.