是否可以通过AWS CloudFront使用http基本身份验证?

问题描述 投票:4回答:1

我正在尝试将CloudFront分布放在使用基本http身份验证的百胜(RPM)存储库的前面。我已经设置了带有HTTPS的CloudFront分配,具有以下值从HTTP重定向到HTTPS:

Origin: yum.mydomain.com
Origin ID: smp-yum.mydomain.com

注意:smp-yum.mydomain.com目前不存在,我不确定是否需要?

出于测试目的,我严格使用abcdefgh.cloudfront.net域。

我在尝试访问URL时遇到以下错误:

CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection. 

因为我知道主机已启动,并且接受来自公共Internet的连接,所以我只能假定这是由于http基本身份验证所致。

我还尝试通过以下方式将凭据包含在请求中:>

https://username:[email protected]/repo/url

我想这是一个分为两部分的问题:是否可以使用HTTP Basic Auth?如果是的话,是否有一些标题或我需要自定义的标题才能使它起作用?

我正在尝试将CloudFront分布放在使用基本http身份验证的百胜(RPM)存储库的前面。我已经设置了带有HTTPS的CloudFront分配,从HTTP重定向到HTTPS,...

amazon-web-services amazon-cloudfront yum basic-authentication
1个回答
0
投票

您应使用lambda @ edge。这是简单的自动方法(不需要aws控制台单击):https://tracklify.com/blog/simple-basic-auth-in-aws-cloudfront-with-serverless

© www.soinside.com 2019 - 2024. All rights reserved.