I have an ASP.NET MVC 4 application running behind Amazon's elastic load balancer. Everything works fine when I install my SSL certificate on the load balancer and the web server and complete the SSL at the web server level.
However, when I try to shut down at the load balancer level, redirecting internal traffic from the load balancer to unencrypted web servers on port 80, the RequireHttps attribute causes a redirect loop. This seems to make sense, as it requests an encrypted channel and does not know that it receives one (between the browser and the load balancer). Has anyone encountered this problem? Any suggestions would be appreciated!
Edit: solution
The following links may be useful to anyone who encounters this problem:
MVC3, RequireHttps and custom handler result in http 310
https://gist.github.com/915869
source share