2017-04-11 92 views
1

我正在使用帶有Node.js服務器,負載均衡和Nginx代理的Elastic Beanstalk。我希望將所有地址http://example.com重新路由到https://example.com將http轉發到https - Elastic Beanstalk + Nginx

我已經試過低於居住在.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; 
     } 

我的負載均衡有80指向80和443指向80: enter image description here

回答