【问题标题】:Using Cloudfront as a HAProxy backend server with https使用 Cloudfront 作为带有 h​​ttps 的 HAProxy 后端服务器
【发布时间】:2020-11-06 04:08:18
【问题描述】:

我的 S3 存储桶前面有一个 CloudFront 资源。它可以在——

https://<id>.cloudfront.net

但如果我打——

<id>.cloudfront.net:443

我收到 400 错误请求。我想在我的 HAProxy 配置中指向 CloudFront,但由于上述问题,我无法使用 443 端口。我也不能在服务器语句中使用https URL 协议。

backend my_cloudfront_app
    http-response set-header Strict-Transport-Security max-age=31536000
    server my_server <id>.cloudfront.net:443

如何从 HAProxy 中的此服务器块访问 HTTPS 云端?

【问题讨论】:

    标签: https amazon-cloudfront haproxy


    【解决方案1】:

    我假设您需要向云端后端的请求标头添加一些信息。

    此示例适用于 HAProxy 2.0

    backend my_cloudfront_app
        http-response set-header Strict-Transport-Security max-age=31536000
    
        # Add backend header for cloudfront backend request
        http-request set-header Host <id>.cloudfront.net
    
        # maybe you will need to add a S3 prefix to the request path
        # http-request set-path <CLOUDFRONT_S3_Prefix>%[path] 
    
        server my_server <id>.cloudfront.net:443 sni str(<id>.cloudfront.net) ssl verify none
    

    【讨论】:

      猜你喜欢
      • 2022-10-13
      • 1970-01-01
      • 1970-01-01
      • 2013-09-02
      • 2018-11-30
      • 1970-01-01
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      相关资源
      最近更新 更多