简体   繁体   中英

How can I add an SSL certificate to my already existing node.js server?

I have a node.js server made with keystone.js, but before launching it I need to add an SSL certificate. All the examples and tutorials I've seen to add an SSL certificate to a node.js server only show how to create a new https server from scratch.

I already have my entire application and api working off http, is there a simple way to make it all work on https?

I'm not sure why you think you need to do this without restarting the application; it's a pretty low cost thing to do.

That said, the simplest approach would be to put up an Nginx web server in front of it, and then setup the Nginx server as the https endpoint and proxypass the requests forward to your node process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM