0

I have a single domain, which is pointed to the frontend(Reactjs) of the application hosted on cPanel. The backend(Nodejs) of the application is on a Linode VPS. The frontend of the application communicates with the backend through APIs.

Every thing was good in development phase but now in production the browser doesn't allows to use APIs with http (Was giving mixed content error) and to resolve this issue I changed it to HTTPS from HTTP and configured nginx with self signed certificate. Now I'm able to make requests from the browser using the IP Address of my server and I don't want to use domain for that but it shows the warning that the certificate is not trusted. How can I resolve this issue as I don't want to use another domain for the backend server.

  • Can you please include the way that you generated the self-signed certificate in your question? Also, what I would recommend is to use Caddy instead of Nginx if it's a new project. Will free you from a lot of hassle and will automatically generate SSL certificates for you. – michaelgrigoryan25 Sep 10 '21 at 16:05
  • Related: [Is it possible to have SSL certificate for IP address, not domain name?](https://stackoverflow.com/q/2043617/691711). – zero298 Sep 10 '21 at 16:07
  • A browser isn't going to ever trust self-signed certs unless you add them to your system or browser's (in the case of Firefox) certificate store. As to the idea of using IP in production, I ***really*** wouldn't recommend it. IPs can change. It's a lot easier to lose an IP than it is to lose a domain. It's much easier to to point a DNS at a new IP instead of having to regenerate all of your certs to match the new IP which could possibly again if your ISP or hosting provider messes something up. – zero298 Sep 10 '21 at 16:10
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 17 '21 at 14:23

0 Answers0