NodeJS server access to SSL certs

Hello! :blush:

I am using a small nodejs app and need to allow it to use the let’s encrypt SSL certs from one of my sites. I do not want to manually change them monthly, so what would be the best way to use the certs in the Hestia directories? Or is there a better way?

Thank you for your time!

OK, let me ask this, if I change the permissions on the certs to be readable, when they are regenerated will the permissions be reset by Hestia?

I’m just trying to figure out my best option. Hope someone can give advice.

Thank you

Not sure about changing the permissions, which might negatively affect your security. But it would be possible to run a cron job to do that regularly, or copy the certs to a different directory.

Another way would be to use nginx as an SSL terminating proxy in front of the node.js app. Eg if the node app runs on port 8123 then get nginx to forward from 443 to 8123. There are examples of node.js nginx proxy templates in these forums.

1 Like

@pluto thank you, and I have been runing my app behind nginx, so the reverse proxy is http and not an issue. However, I just went to a 32 core box, and I’m using OME (OvenMediaEngine) and it too requires certs.

I’m just trying to figure the best way to get them available to the services that need them. I imagine I’ll end up with cron job checking if file was changed, then copy to new location, restart OME and my pm2 instance.

@pluto thank you for the response. :pray: