- Newest
- Most votes
- Most comments
When running IIS behind an Application Load Balancer (ALB) that handles SSL termination, there are a few key considerations that might be causing your authentication loop:
-
X-Forwarded Headers: The ALB needs to pass the original client information to your IIS server. Make sure your ALB is configured to forward the X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port headers. IIS needs these headers to understand that the original request came via HTTPS, even though it's receiving HTTP traffic from the ALB.
-
URL Rewrite Module: Unlike Tomcat, IIS often requires the URL Rewrite module to properly handle SSL-offloaded scenarios. This module helps IIS understand that the original request was HTTPS even though it's receiving HTTP from the ALB. You may need to install this module and configure it to respect the X-Forwarded-Proto header.
-
Application-Specific Configuration: Your authentication loop could be happening because the application is detecting that it's receiving HTTP traffic (from the ALB to IIS) and is trying to redirect to HTTPS, creating a loop. This is common when applications have built-in security redirects.
-
Cookie Settings: Even though you only have one target, check if your application's cookies are being set with the Secure flag. If they are, but IIS thinks it's serving HTTP content, browsers won't accept these cookies, potentially causing authentication issues.
For IIS specifically, you might need to:
- Install the URL Rewrite module
- Create a rewrite rule that sets HTTPS server variable to "on" when X-Forwarded-Proto is "https"
- Ensure your application is configured to trust proxy headers
This configuration allows IIS to properly understand it's behind an SSL-terminating load balancer, which is likely why your Linux/Tomcat setup worked without additional configuration (as Tomcat often handles this scenario more gracefully by default).
Sources
AWS Application Load Balancer, sticky sessions, and failover | AWS re:Post
How do I set up SSL to my ec2 instance via a load balancer? | AWS re:Post
ALB Node SSL Connection Failure - One of Two Nodes Returns SSL_ERROR_SYSCALL in eu-central-1 | AWS re:Post
answered a year ago
Relevant content
asked 3 years ago
asked 2 years ago
