302 Infinite Loop

Johnie Karr picture Johnie Karr · Jul 2, 2012 · Viewed 8.5k times · Source

I have a web application that is stuck in an infinite loop, and I have no idea where to look next. This is an intranet site, so there is no link I can share, but I've listed as many details as I can think of below. I would appreciate any ideas or suggestions. Anyone has.

The details:

  • IIS 7
  • .Net 4.0
  • Windows 2008
  • Default document is Login.aspx
  • No HTTP redirect set on app or Login.aspx in IIS
  • Fiddler shows Login.aspx using status code of 302 and redirecting to Login.aspx

If I open my site, it points to Login.aspx and gets stuck in a 302 loop. If I open the site but point to register.aspx, Fiddler shows register.aspx going to Login.aspx which of course redirects to Login.aspx.

What I've done:

  • Run the webapp from Visual Studio -- everything works fine
  • Check web.config for redirect commands -- there are none
  • Check IIS for redirect commands -- there are none
  • Look at Fiddler for another page in the loop -- there are none, just Login.aspx to Login.aspx
  • Check Login.aspx for redirect commands -- there are none
  • Check Login.aspx code behind for redirect commands -- there are none
  • Run the app on my box using the web.config from the server -- everything works
  • Check Login.aspx for redirect commands -- there are none
  • Cleared Cache -- problem still persists
  • Republished -- problem still persists
  • Republished and cleared Cache -- problem still persists
  • Disabled Default Document in IIS

Answer

Paddy picture Paddy · Jul 2, 2012

Will share this just in case it is an answer, as it sounds like a problem we had.

  1. ASP.net MVC site with [RequiresHttps] attribute on our login action.

  2. Behind a load balancer that was doing SSL acceleration (resulting in the request that actually hits the server side code being already decoded and effectively under http).

  3. Server code thinks this is an issue and redirects back to itself using https.

  4. Rinse and repeat.