'How to enable HTTPS SSL with Let's Encrypt Cert working on all ports?

I have a clean Ubuntu VPS, Nginx, Certbot and Nodejs installed on it. I also generated Let's Encrypt Cert in auto mode for mo domain. All configs are very basic, nothing changed as of yet. Now when I go to https://my-site.domain the default nginx page opens and shows that connection encrypted. Then I deployed my Nuxt app (host changed to 0.0.0.0 of course) and tried to connect on port 3000. It says that connection is NOT encrypted and gives error when trying to connect over HTTPS (ERR_SSL_PROTOCOL_ERROR). When I used HestiaCP as a control panel I didn't have that issue. So, what is the way to use SSL certificate on ALL ports?



Sources

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

Source: Stack Overflow

Solution Source