Ghost Https index.js in GitHub
In Ghost Blog Self Hosted HTTPS With Node.JS I talk about running Ghost Blog with https using nodejs only.
Update 2017/03/16 - Code in this post work for Ghost 0.11.4 but not 0.11.7.
If you are running Ghost 0.11.7 or later, please check the latest version from my GitHub repository. Link provided at the end of post.
Since then I have enhanced it according to my need. Replaced the https
package with spdy
to support http2.
The resulting index.js
can be divided in two parts.
Part 1
Part 1 contain 99% of the code added to the original Ghost index.js file.
In addition to pulling in required libraries, it also set the cypher suite, and handle http to https redirect.
Just remember to fill-in your certificate info.
|
|
Part 2
Part 2 is mainly the original Ghost index.js
file with only one line comment out and one line for starting the Ghost with https.
|
|
Conclusion
Putting the two parts together give you a drop-in replacement of the original index.js
file and enable you run Ghost with https without additional packages.
The file is hosted in GitHub ghost-https-indexjs with instructions.
A standalone proxy version is here: ghost-https-nodejs-proxy.