- Newest
- Most votes
- Most comments
This issue you're experiencing with the ASP.NET site redirecting to HTTPS despite being configured to listen on port 80 could be caused by several factors. Here are some approaches to help identify and resolve the problem:
-
Check for URL Rewrite rules: Even if you don't see explicit redirects in IIS settings, there might be URL Rewrite rules in place. Look for a web.config file in the root directory or subdirectories of your application that might contain these rules.
-
Inspect application code: The redirect could be happening within the ASP.NET application code itself. Look for any middleware or filters that might be forcing HTTPS.
-
Examine global.asax: Check the global.asax file for any application-level event handlers that might be initiating a redirect.
-
Review web.config: Double-check the web.config file for any configuration settings that might be enforcing HTTPS, such as the "requireSSL" attribute on forms authentication.
-
Check for security headers: Look for any security headers being set by the application that might be forcing HTTPS, such as Strict-Transport-Security (HSTS).
-
Investigate third-party modules: If your application uses any third-party modules or components, they might be configured to enforce HTTPS.
-
Use network monitoring tools: Utilize tools like Fiddler or browser developer tools to capture and analyze the HTTP traffic. This can help you see exactly where and when the redirect is occurring.
-
Test with a bare-bones application: Create a simple "Hello World" ASP.NET application and deploy it to the same IIS server. If this doesn't redirect, it suggests the issue is within your application rather than the IIS configuration.
-
Check for load balancer settings: If there's already a load balancer in front of your EC2 instance, verify its settings to ensure it's not initiating the HTTPS redirect.
-
Temporary workaround: As a temporary measure to aid in testing, you could try adding a binding for port 443 in IIS, even without a valid SSL certificate. This might allow you to access the site while you continue to investigate the root cause.
Remember, once you identify and resolve the cause of the redirect, you'll be able to maintain the site listening on port 80 in IIS, which aligns with your plan to offload SSL at the ALB or CloudFront level in the future.
If these steps don't lead you to the source of the problem, you might need to engage in more detailed application-level debugging or consider reaching out to AWS support for further assistance.
Sources
Issue with File Downloads via HTTPS on Application Behind Application Load Balancer | AWS re:Post
Package an IIS-based application - AWS End-of-Support Migration Program (EMP) for Windows Server
Relevant content
- asked 2 months ago
- asked 3 years ago
hi, curl -v http://<actual-hostname>
the verbose flag will show all request and response headers, including location header that is responsible for redirect.
you will find the what it causing HTTPs redirect. best