'How to make NodeJS API ssl enabled?

I have one AWS EC2 machine and my client and API applications both deployed in the same machine. I have enabled SSL for client (react app) but when I enabled it this time I could not fetch data from API because it is not SSL enabled it serves from "HTTP" not "https" so I get et::ERR_SSL_PROTOCOL_ERROR error. I looked some ways to enable SSL from API, I can use nginx SSL but my client uses nginx SSL with port 443. How my API can serve from the same port?

I could not solve this issue before client SSL enabled, it worked with API but now I does not.

Could you help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source