jwchang
jwchang

Reputation: 10864

Node.js + SSL on Heroku. SSL handled by Nginx or Node.js?

I'm currently using

Express 2.x

Node 0.8.x


Do I have to pass

key and cert parameters to express.createServer() to handle SSL by Node.js?

Or SSL is handled by Nginx on Heroku?

Upvotes: 2

Views: 937

Answers (1)

thatmarvin
thatmarvin

Reputation: 2880

Nope, SSL termination happens at the load balancer, before encrypted traffic reaches your node app:

browser <--HTTPS--> nginx <--HTTP--> node

You can check req.headers['x-forwarded-proto'] === 'https' to see which protocol the request came in with.

Related: configure jetty ssl in heroku

Upvotes: 3

Related Questions