an nodejs expressjs router, giving you outward https encryption with certificates issued from letsencrypt.
basically my script i use for https certs on deployment.
npm install -g routerjon
mkdir routerjoncd routerjontouch config.json
config json should list the different domains you will use. and to which routerjon should redirect them.
for example the config running on my deployment at blogjono.com is
"ports":"http": 80"https": 443"production": true // server for letsencrypt, note production has rate limit"domains":"blogjono.com" "*.blogjono.com""opentorah.uk" "*.opentorah.uk""email": "firstname.lastname@example.org""router": // these are servers already running on the machine"blogjono.com": 9000"fcc-pin.blogjono.com": 9001"opentorah.uk": 9002"booktrade.blogjono.com": 9003
The default config fills in any gaps missed by your config.
"ports":"http": 3000"https": 3443"production": false"spdy": false // option to use an experimental http2 server"domains":"localhost:3000": 9000
[sudo] routerjon ./conifg.json
run (in background)
nohup routerjon ./config.json
make sure you are in a directory with a file named exactly
when routerjon crashes it will foreverjs process manager will restart it
[sudo] npm i -g forever touch routerjon_forever
#!/bin/sh routerjon ./config.json
[sudo] forever start -c bash routerjon-forever
you may need sudo or root privallages to run the command with the server ports 80 and 443. you will also need to stop any other servers (like nginx, apache) listening on these ports
by default when you edit the config with valid json and save the file, changes will be automatically reloaded (thanks to node-watch). This makes it easy to vim into and fiddle with the routers port numbers
the script will store your certificates in the
i am not sure the
greenlock-express module causes them to autorenew.
author & licence
author: Jonathan T L Lee
feel free look around the code. its only 176 lines