简体   繁体   English

如何让用户通过我的自定义域访问亚马逊s3 html / javascript页面?

[英]How can I let users visit amazon s3 html/javascript pages through my custom domain?

I have a pyramid/python application with a page at www.domain.com that creates html pages at s3.amazonaws.com/testbucket/object_name. 我有一个金字塔/ python应用程序,页面位于www.domain.com,可以在s3.amazonaws.com/testbucket/object_name创建html页面。 Right now in this test bucket, I also have javascript files that each object(html page) utilizes. 现在在这个测试桶中,我还有每个对象(html页面)使用的javascript文件。 I want it so that users can go to subdomain.domain.com/object_name and see the files with the javascript enabled. 我想要它,以便用户可以访问subdomain.domain.com/object_name并查看启用了javascript的文件。 I have cname'd subdomain.domain.com (the name of my bucket) to s3.amazonaws.com. 我有sname'd subdomain.domain.com(我的桶的名字)到s3.amazonaws.com。 (with that last period at the end). (最后一段时间结束)。 Right now I have two problems (I am far more concerned with the second one) 现在我有两个问题(我更关心第二个问题)

1). 1)。 When I try and access the url via https://subdomain.domain.com/object_name I get a security error (I assume this is because it is redirecting to an amazon s3 bucket. How can I get an ssl certificate for my bucket? 当我尝试通过https://subdomain.domain.com/object_name访问网址时出现安全错误(我认为这是因为它正在重定向到亚马逊s3存储桶。如何获得我的存储桶的ssl证书?

2) When I try and access the url via http://subdomain.domain.com/object_name , there is no secutiry error (not https) but the javascript isn't enabled. 2)当我尝试通过http://subdomain.domain.com/object_name访问网址时,没有安全性错误(不是https),但未启用javascript。 How can I make sure that those jacvascript files on the s3 bucket still work? 如何确保s3存储桶上的那些jacvascript文件仍然有效?

Edit: upon looking at the developer tools, I see the error: Failed to load resource: the server responded with a status of 403 (Forbidden) referring to the javascript file. 编辑:在查看开发人员工具时,我看到错误:无法加载资源:服务器响应状态为403(禁止)引用javascript文件。 Why would this file be forbidden when I have made it public in the bucket? 为什么这个文件在桶中公开时会被禁止?

S3 does not allow you to configure your own SSL certificates for buckets - this is an inherit "problem" with the way S3 is designed and distributed across servers - Amazon provides their own certificate for use with S3, no configuration required. S3不允许您为存储桶配置自己的SSL证书 - 这是S3设计和分布在服务器上的方式的继承“问题” - 亚马逊提供自己的证书供S3使用,无需配置。

However , and this is very important - you cannot use SSL over CNAME, period. 但是 ,这非常重要 - 您不能在CNAME期间使用SSL。 If you want to use your pretty domain name with SSL using S3 you're out of luck. 如果你想使用S3使用漂亮的域名和SSL,那你就不走运了。 Its just a S3 quirk we have to live with. 它只是我们必须忍受的S3怪癖。 ( https://forums.aws.amazon.com/thread.jspa?threadID=60502 ). https://forums.aws.amazon.com/thread.jspa?threadID=60502 )。

In summary, if you want SSL, you must use the full S3 bucket path. 总之,如果您需要SSL,则必须使用完整的S3存储桶路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让我的 HTML 文件访问 Amazon S3 存储桶中的 CSS 和 JavaScript 文件? - How can I get my HTML file to access my CSS and JavaScript files in an Amazon S3 Bucket? 如何在Amazon s3中保存的html页面上引用外部javascript库? - How can I reference an external javascript library on an html page saved in amazon s3? 如何使用AngularJS 2使用Amazon S3 JavaScript API? - How can I consume Amazon S3 JavaScript APIs with AngularJS 2? 如何让用户浏览那里的计算机以选择HTML JAVASCRIPT中的背景图像 - How can I let users browse there computer to choose a background image in HTML JAVASCRIPT 如何使用签名的 URL 和 JavaScript 将二进制字符串文件上传到 Amazon S3? - How can I upload a file that is a binary string to Amazon S3 using a signed URL and JavaScript? 让用户访问随机分配的所有html页面,确保没有页面被重复jquery / javascript - let user visit all html pages randomly assigned, making sure no page is repeated jquery/javascript jQuery JavaScript-如何让用户“撤消”他们的修改? - Jquery javascript - How can I let users 'undo' their modifications? 如何自动浏览器访问1000页并在每个页面上触发简单的javascript函数? - How can I automate a browser to visit 1000 pages and trigger a simple javascript function on each page? Cordova / Phonegap通过javascript将图像上传到Amazon S3 - Cordova/Phonegap upload image to amazon S3 through javascript 如何将 Amazon S3 存储桶中的 javascript 连接到 Amazon 时间服务器? - How to connect javascript in Amazon S3 bucket to Amazon time server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM