I have a website that runs HTTPS correctly in my local environment. When I upload it to AWS, it just stops or redirects forever.
My installation in AWS is an Elastic Beanstalk application, an RDS database with MS SQL, I added a load balancer to forward HTTPS requests, and I have an SSL certificate correctly assigned to the load balancer. From all that I can say, my application works, in fact, the Entity Framework launched and correctly built my database in my RDS instance. I just can’t access the site via the Internet.
I tried to configure Listeners in many ways. If I install them like this, they simply redirect forever:
If I install them like this, then time will just come out: 
I have the code redirects HTTP / HTTPS port by default in my Startup.cs :
public void ConfigureServices(IServiceCollection services)
{
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
var options = new RewriteOptions().AddRedirectToHttps();
app.UseRewriter(options);
...
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor |
ForwardedHeaders.XForwardedProto
});
...
}
I spent days on it and cannot make it work. I tried to remove all my HTTPS code and it does not work. I have tried code solutions from blogs like this and this, and this also does not work. From what I read, the load balancer completes the processing of the HTTPS request and then redirects the HTTP request to my application. But I don’t know how to handle this properly, still apply HTTPS and redirect HTTP to HTTPS.
, -, . , , , . - ? .
, .