HTTP to HTTPS after ELB

0
397

TOOL KIT FOR VS http://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/deployment-beanstalk-custom.html

Login problem: https://github.com/aspnet/Mvc/issues/4072

http://stackoverflow.com/questions/38748989/deploy-asp-net-core-mvc-behind-nginx-that-does-ssl-termination-redirects-to-no

HTTP to HTTPS redirects on IIS 7.x and higher

The ELB supports a HTTP header called X-FORWARDED-PROTO. All the HTTPS requests going through the ELB will have the value of X-FORWARDED-PROTO equal to https. For the HTTP requests, you can force HTTPS by adding a simple rewrite rule follows this header.

https://oanhnn.github.io/2016-02-29/how-to-force-https-behind-aws-elb.html

http://stackoverflow.com/questions/33088536/aws-ec2-run-a-script-on-instance-launch-with-windows-server-2012

https://blog.3d-logic.com/2016/06/08/running-asp-net-core-applications-with-iis-and-antares/

Upon receiving the request the ASP.NET Core Module will attempt to start the application if it is not already running. The name of the process to start and its arguments are specified in web.config  as the processPath and arguments attributes on the aspNetCore element. ASP.NET Core Module also sets a few environment variables for the application process – ASPNETCORE_PORT , ASPNETCORE_APPL_PATH and ASPNETCORE_TOKEN. Here is where the UseIISIntegration magic happens. When the application starts, the code inside UseIISIntegration method tries to read these environment variables and if they are not empty they will be used to configure the url/port the application will listen on. (If the above environment variables are not set UseIISIntegration won’t try to configure anything so that you can use your own settings when running the application directly (i.e. without IIS)). One important detail to pay attention to is where you put the call to UseIISIntegration when configuring your application with WebHostBuilder. You need to make sure that you don’t try to set server urls after you called UseIISIntegration otherwise the url set by UseIISIntegration will get overwritten and your application will be listening on a different port that Asp.NET Core Module expects. As a result things will not work.

NO COMMENTS