AWS Cloudfront重定向到S3存储桶 [英] AWS Cloudfront redirecting to S3 bucket
问题描述
我创建了一个Cloudfront发行版来服务静态网站。 S3是原始服务器。
现在,如果我们访问cloudfront URL,它将重定向到S3位置。
I have created a cloudfront distribution to serve the static website. S3 is origin server. Now if we access cloudfront url, it redirects to S3 location.
d2s18t7gwlicql.cloudfront.net
或
test.telekha。在
d2s18t7gwlicql.cloudfront.net or test.telekha.in
在浏览器中显示
https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/dashboard
我期望 https://test.telekha.in /#/仪表板
如果我访问 https:/ /test.telekha.in 通过curl返回我的index.html文档
If I access https://test.telekha.in through curl it returns my index.html document
如果我访问 http://test.telekha.in 通过卷曲返回
If I access http://test.telekha.in through curl it returns
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>CloudFront</center>
</body>
</html>
但是在浏览器中,http和https都重定向到 https://telekha-test-www.s3.ap-south-1.amazonaws.com/ index.html#/
But in browser both http and https are redirecting to https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/
请让我知道如何解决此问题。
Please let me know how to resolve this issue.
推荐答案
我发现了问题。它具有Cloudfront配置。
此博客对我有所帮助。
I found the issue. It is with cloudfront configuration. This blog helped me.
在定义起点时,我直接选择了S3存储桶。我们应该输入S3存储桶的域,例如telekha-test-www.s3-website.ap-south-1.amazonaws.com
While defining the origin I have directly selected S3 bucket. We should enter the domain of the S3 bucket like telekha-test-www.s3-website.ap-south-1.amazonaws.com
这篇关于AWS Cloudfront重定向到S3存储桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!