Redirection from http to https (Pencilblue Elastic Beanstalk)

64 views Asked by At

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.

1

There are 1 answers

2
Wasif Ali On BEST ANSWER

I have countered this issue and got a solution, you can set use_x_forwarded to true in config.js file.