![](/img/trans.png)
[英]HTTP/HTTPS nodejs servers on Amazon elastic beanstalk
[英]Forward http to https - Elastic Beanstalk + Nginx
我正在使用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;
}
從你的問題不清楚到底出了什么問題,但也許你可以在重寫條件下使用x-forwarded-proto。
我自己沒有試過這個,但也許是這樣的: 如何在http到nginx docker elastic beanstalk中將http重定向到https
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.