express-ssl-redirect

0.0.2 • Public • Published

Express SSL Redirect

Express 4.x middleware for SSL-only sites. Redirects http requests to https.

Similar to https://www.npmjs.com/package/force-ssl except it has a simpler setup (as it makes the requires Express 'app' for non-SSL users)

Usage:

Typically in /bin/www:

var sslRedirect = require('express-ssl-redirect');

Then:

sslRedirect(80, 'example.com');

Of course, you should probably run node as a non-root user, which means binding to port above 1024, and mapping incoming port 80 connections to that high numbered port and incoming port 443 connection to another high numbered port. Check out How I deploy node apps on Linux, 2015 edition for information on running express as a non-root user.

Dependents (0)

Package Sidebar

Install

npm i express-ssl-redirect

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • mikemaccana