How can I allow users to visit amazon s3 html / javascript pages through my user domain?

I have a pyramid / python application with a page on www.domain.com that creates html pages on s3.amazonaws.com/testbucket/object_name page. Right now in this test bucket, I also have javascript files that every object uses (html page). I want users to be able to go to subdomain.domain.com/object_name and view the files with javascript enabled. I have cname'd subdomain.domain.com (my bucket name) on s3.amazonaws.com. (with this last period at the end). Now I have two problems (I am much more interested in the second)

1). When I try to access the url via https://subdomain.domain.com/object_name , I get a security error message (I assume this is because it is being redirected to the amazon s3 bucket. How can I get ssl certificate for your bucket?

2) When I try to access the URL through http://subdomain.domain.com/object_name , there is no secutiry error (not https), but javascript isn’t. How can I make sure that these jacvascript files in the s3 bucket still work?

Edit: when viewing developer tools, I see an error: Could not load the resource: the server responded with the status 403 (Forbidden), referring to the javascript file. Why would this file be banned if I published it in a bucket?

+6
source share
1 answer

S3 does not allow you to configure your own SSL certificates for codes - it is a problem of inheritance with how S3 is designed and distributed between servers - Amazon provides its own certificate for use with S3, without the need for configuration.

However , and this is very important - you cannot use SSL through CNAME, period. If you want to use your beautiful domain name with SSL using S3, you're out of luck. Its just a S3 quirk that we have to live with. ( https://forums.aws.amazon.com/thread.jspa?threadID=60502 ).

Thus, if you want to use SSL, you must use the full path to the S3 stuff.

+3
source

All Articles