Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect http hits to https #1240

Open
wasifali opened this issue Mar 14, 2017 · 2 comments
Open

Redirect http hits to https #1240

wasifali opened this issue Mar 14, 2017 · 2 comments
Labels

Comments

@wasifali
Copy link

Hi @brianhyder,

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

I tried adding the "server" object in config.js as mentioned in #1005 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 http hits to https?

Thanks a lot.

@danielgeri
Copy link

@wasifale I found that setting use_x_forwarded to true. will work :)

@brianhyder
Copy link
Member

@wasifale A lot of it depends on your situation. This is why we do not commit a config.js file. Each environment is different. Even for your development purposes you should have a local config file to use and then a production only config.js file. This is where CI/CD tools come in handy. It allows you to protect credentials to production DBs and other resources.

The other piece to consider is if you are using an ELB check if you are using SSL termination at the ELB or if you are passing the encrypted SSL content to the beanstalk instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants