我正在使用Elastic Beanstalk和Node.js服务器,Load Balanced和Nginx代理。我希望将所有地址http://example.com重新路由到https://example.com。
我已经尝试过下面的配置,它位于.ebextensions中,看起来像这样:
files:
"/etc/nginx/conf.d/000_https_redirect.conf":
mode: "000755"
owner: root
group: root
content: |
server {
listen 80;
return 301 https://$host$request_uri;
}
答案 0 :(得分:0)
从你的问题不清楚到底出了什么问题,但也许你可以在重写条件下使用x-forwarded-proto。
我自己没有尝试过,但也许是这样的:how to redirect http to https in nginx docker elastic beanstalk