Unable to force HTTPS for website running ASP.NET on Elastic Beanstalk AWS (With classic Load Balancer)

前端 未结 1 941
刺人心
刺人心 2021-01-24 10:02

So I\'ve finally been able to successfully create a https website. It is just running the template ASP.NET web project. I have a certificate, and this is added to the ELB (Elast

1条回答
  •  囚心锁ツ
    2021-01-24 10:22

    I find it best to add a CloudFront Distribution, with "Redirect HTTP to HTTPS" set. CloudFront terminates the TLS session with your cert, then talks to your Elastic Beanstalk's ELB using http, though public internet users are automatically redirected to the HTTPS endpoint.

    This can be achieved following these steps:

    1. Go to CloudFront > Create Distribution > Web
    2. Select the ELB Origin
    3. Select Viewer Policy: Redirect HTTP to HTTPS
    4. Select Cache Based on Headers: All (this allows caching per user, though you may want to refine this later)
    5. Object Caching : Customize (disables default caching, review later to optimize)
    6. Enter Minimum, Maximum and Default TTL as 0
    7. Cookies and QueryString to All
    8. Select appropriate Price Class, less regions are cheaper.
    9. Alternative Domain Names: add all domain names that you want to be directed at this Distribution
    10. Custom SSL Certificate (this needs to be a certificate in us-east-1 with all the domain names entered above as alternative names.
    11. Once the Distribution has been created, you need to update your DNS CNAME to point to the ___.cloudfront.net address that you are given.

    0 讨论(0)
提交回复
热议问题