Skip to content

Instantly share code, notes, and snippets.

View El-khamisi's full-sized avatar
🧁
cupCake

Mohammed El-khamisi El-khamisi

🧁
cupCake
View GitHub Profile
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active October 30, 2024 20:13
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.