2

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?

jwchang
  • 10,584
  • 15
  • 58
  • 89

1 Answers1

3

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

Community
  • 1
  • 1
thatmarvin
  • 2,800
  • 4
  • 22
  • 31