[英]Redirection from http to https (Pencilblue Elastic Beanstalk)
We're trying to redirect all the hits from http
to https
. 我们正在尝试将所有匹配从
http
重定向到https
。 Currently the application is deployed on elastic beanstalk and it's allowing both http and https, but we only want the https
. 当前,该应用程序已部署在弹性beantalk上,并且允许使用http和https,但是我们只需要
https
。
I've tried adding the server object in config.js
to make the check 我尝试在
config.js
添加服务器对象以进行检查
pb.config.server.ssl.use_x_forwarded && req.headers["x-forwarded-proto"] !== "https"
work in pencilblue.js
, but it broke the code on localhost as well as live. 在
pencilblue.js
工作,但是它破坏了本地主机上的代码以及实时代码。
Could you please suggest a way to redirect all http
hits to https
? 您能否建议一种将所有
http
命中重定向到https
?
Thanks a lot. 非常感谢。
我已经解决了这个问题并找到了解决方案,您可以在config.js
文件中将use_x_forwarded
设置为true。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.