Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Express req.secure returning false on https connection
I am working on an node/express server and have set up nginx with lets encrypt and cerbot on my Droplet. When I access my ip I get the green lock and it says the connection is secure. However, when I try to log req.secure in Express it returns false. As a result, I am having trouble using session authentication with secure cookies.
Some posts are suggesting it could be due to the proxy or load balancer. I am not super familiar with with Digital Ocean, is the a problem others have had? Did I set up my SSL incorrectly (and somehow still get the green lock)?
Thank you in advance
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×