【问题标题】:Redirection to https not working using AWS Elastic Beanstalk使用 AWS Elastic Beanstalk 重定向到 https 不起作用
【发布时间】:2019-10-29 21:24:11
【问题描述】:

我使用 AWS Elastic Beanstalk 为我的应用程序创建了一个环境。我已经使用负载均衡器配置启用了 https。我想将流量从 http 重定向到 https。以下方法我都试过了,还是不行。

1) 我在项目根目录中创建了一个 .ebextensions 文件夹,文件名为 https-redirect-php.config。

2)该文件的内容是从以下文件中粘贴的。 https://raw.githubusercontent.com/awsdocs/elastic-beanstalk-samples/master/configuration-files/aws-provided/security-configuration/https-redirect/php/https-redirect-php.config.

3)我创建了文件夹的zip并部署在服务器上。

4)我也尝试使用 eb cli 命令 eb deploy 但它不起作用。

请给我任何帮助。我真的很感激

【问题讨论】:

  • 我不确定它与 october-cms 无关
  • 是的,我也这么认为

标签: php laravel amazon-web-services amazon-elastic-beanstalk octobercms


【解决方案1】:

一种解决方案是在您的.ebextensions 目录中添加一个配置文件,其中包含以下几行:

option_settings:
  aws:elbv2:listener:443:
    ListenerEnabled: 'true'
    Protocol: HTTPS

看看Configuring Your Elastic Beanstalk Environment's Load Balancer to Terminate HTTPS

【讨论】:

  • 我会试试这个并告诉你。
【解决方案2】:

转到 ELASTIC BEANSTALK -> 配置 -> 负载平衡器 -> 规则

拥有端口和证书后,尝试添加以下规则:

【讨论】:

    猜你喜欢
    • 2016-08-02
    • 2014-07-05
    • 2016-06-19
    • 2023-03-09
    • 2017-05-22
    • 2017-01-07
    • 2016-04-22
    • 2017-05-30
    • 2018-01-01
    相关资源
    最近更新 更多