AWS S3 Virtual Host SSL Does Not Serve Index Page

2019-02-24 11:39发布

问题:

I cannot reconcile a problem with AWS S3 Virtual Hosting. I require SSL and the index page to be served when navigating to the hostname.

  • Serves up index page over plain-text: http://hjr-test.s3-website-us-east-1.amazonaws.com/
  • Not accessible over SSL: https://hjr-test.s3-website-us-east-1.amazonaws.com/
  • Accesible over SSL, but does not serve index page: https://hjr-test.s3.amazonaws.com/
  • Accessible over SSL and serves explicit page: https://hjr-test.s3.amazonaws.com/index.html

Is there a way I can have SSL access and serve the index page?

回答1:

No SSL from S3 Website endpoint. Sorry

$ nc -zv hjr-test.s3-website-us-east-1.amazonaws.com 443
nc: connect to hjr-test.s3-website-us-east-1.amazonaws.com port 443 (tcp) failed: Connection refused
$ nc -zv hjr-test.s3-website-us-east-1.amazonaws.com 80
Connection to hjr-test.s3-website-us-east-1.amazonaws.com 80 port [tcp/http] succeeded!


回答2:

Best I can tell, there are 2 ways to get to your s3 bucket:

  • a plain s3 url (examples 2 & 4 in your question)
  • website url which offers a few extra features (examples 1 & 3)

The s3 url supports SSL, but it's just a raw "get" from the bucket. No fancy stuff. The website url supports special website-specific features like redirect rules & automatic index page redirect, but not SSL.

I don't know why the website urls don't support SSL. Maybe amazon hasn't implemented it yet? Maybe they want you to use the non-region-specific domain for some reason? Maybe they want you to use CloudFront? Maybe their secret overlord council of lizard people has forbidden it on penalty of death.

I'm sure it will be obvious to me once someone explains it to me.

Anyway, that's my understanding anyway after poking around. I'm pretty new to this stuff, so take it with a grain of salt.