tqr tqr - 3 years ago 94
HTTP Question

Redirection from http to https (Pencilblue Elastic Beanstalk)

We're trying to redirect all 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 latter.

I 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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download