Amazon S3的重定向和的Cloudfront [英] Amazon S3 Redirect and Cloudfront

查看:2193
本文介绍了Amazon S3的重定向和的Cloudfront的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置301重定向在S3上使用对象,此处引用<一href="http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html">http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html.我一直有一些问题,似乎无法找出什么我做错了。

I'm trying to setup 301 redirects on S3 using objects, referenced here http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html. I've been having some problems and can't seem to figure out what I'm doing wrong.

我得到的是一个空白页(0字节的文件),就好像网站重定向位置的元数据值未设置。

What I get is a blank page (0 byte file) as if the 'Website Redirect Location' metadata value is not set.

我究竟做错了什么?

同时,做这项工作在AWS上CloudFront的?

我的S3控制台设置

My S3 Console Setup

几件事情需要注意:

我有这样的设置托管静态网站。 我使用SSL / HTTPS用我自己的证书上载并在CloudFront的分布设置。 所有的页面似乎工作除了重定向的对象。 我试着设置路由规则,但他们似乎并没有在的Cloudfront工作。

I have this setup for hosting a static site. I'm using ssl/https with my own cert uploaded and set on the cloudfront distribution. All the pages seem to work except the redirecting objects. I've tried setting up routing rules but they didn't seem to work in Cloudfront.

我想通过CloudFront的URL和S3 URL( https://s3.amazonaws.com/ {斗} /用户/ sign_in)

I'm trying to access the redirects both through the cloudfront url and the s3 url (https://s3.amazonaws.com/{bucket}/users/sign_in)

推荐答案

对于S3的网站一样的功能,如重定向,HTML错误信息,和索引文件,则不能使用REST端点(如S3。 amazonaws.com),因为这些特征仅仅是由网站提供的端点(例如bucketname.s3-website-us-east-1.amazonaws.com)。

For web site-like functionality in S3, such as redirects, html error messages, and index documents, you can't use the REST endpoint (e.g. s3.amazonaws.com) since these features are only provided by the web site endpoints (e.g. bucketname.s3-website-us-east-1.amazonaws.com).

<一个href="http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html">http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html

要做出的Cloudfront可用的行为,你需要配置的Cloudfront使用这个端点,还有,没有休息1通过自动完成在控制台中提供。需要注意的是网络emdpoints不支持HTTPS,但您可以配置的Cloudfront从桶里有HTTP,即使客户端连接是HTTPS来获取。

To make the behavior available in Cloudfront, you need to configure Cloudfront to use this endpoint, as well, not the REST one offered via autocomplete in the console. Note that the web emdpoints do not support HTTPS, but you can configure Cloudfront to fetch from the bucket with HTTP even though the client connection is HTTPS.

这篇关于Amazon S3的重定向和的Cloudfront的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆