【发布时间】:2019-01-24 19:15:51
【问题描述】:
我希望在 Elastic Beanstalk 上使用 nginx 作为代理系统从 HTTP 请求重定向到 HTTPS。
我在 Google 上找到了很多建议,但没有人提供帮助,它不会重定向。
这是我当前在.ebexentions 目录中的test.config 文件:
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000644"
owner: root
group: root
content: |
server{
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
}
我也尝试了无数其他设置,但都没有奏效。
我希望你能帮助我。 :)
【问题讨论】:
-
您的 EB 设置是否带有负载均衡器?您是否查看了这篇 SO 文章中的所有内容? stackoverflow.com/questions/24297375/…
标签: amazon-web-services nginx amazon-elastic-beanstalk