force HTTPS connections to your app
Redirect users on plain HTTP connections to HTTPS. For Express apps.
Make sure to put it before any other middleware, especially
If you're behind a reverse proxy or load balancer (such as on the awesome Nodejitsu PaaS), you'll have to tell Express to trust the proxy's
If you're not using Express, you can use the trust-proxy middleware for this.