Set up SSL on React frontend with *Django backend*

I have two droplets (each with Ubuntu 20.04.3 LTS) on digital ocean which are used for frontend (React 17.0.2) and backend (Django 2.2.5) server, both with Nginx 1.18.0. The frontend is connected to a domain-name while the backend is not.

I was following the tutorial on digitalocean ( on how to secure nginx. I succeeded in setting up SSL for the frontend (React App). However, when I finished, the backend (Django 2.2.5) was not connected anymore or at least the frontend failed to get the data it usually got from there.

On stackoverflow I found a related question but with no satisfiable answer. My backend currently has no domain name connected to it (is accessed via IP address) and therefore Let’s encrypt certificate does not work.

My questions:

  1. Do I need to connect my backend to a (sub)domain name as well for this to work?
  2. Is this (adding SSL also to the backend) really the source of this problem or might it be solved by just adjusting a config file on the backend server?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Problem solved by adding subdomain for backend django server as well, installing LetsEncrypt certificate via certbot (and adjusting backend URL on the frontend to the new After this, enabling HTTPS on the frontend side did not anymore break the connection and website works now flawlessly.

Hope this helps if someone runs into the same issue.