1

We're trying to redirect all the hits from http to https. Currently the application is deployed on elastic beanstalk and it's allowing both http and https, but we only want the https.

I've tried adding the server object in config.js to make the check

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.

Could you please suggest a way to redirect all http hits to https?

Thanks a lot.

4

1 回答 1

2

我已经反驳了这个问题并得到了解决方案,您可以在文件中设置use_x_forwarded为 true 。config.js

于 2017-07-26T10:26:21.387 回答