How to Deploy a Flask Backend and Next.js Frontend Together in Azure Web Services

Ruddy Simonpour 0 Reputation points
2024-12-12T00:38:19.0066667+00:00

We created an application using Next.js React for the front-end and Flask for the back-end. We successfully developed and tested the app locally using Docker. For deployment in Azure, we:

  1. Created a container registry
  2. Tagged Docker images
  3. Created individual Web App services for backend and frontend

However, during Azure deployment, we encountered a Mixed Content error:

  • The frontend page loads over HTTPS
  • An API request attempts to connect via HTTP
  • Browser blocks the request with the message: "Mixed Content: The page at 'https://xxxxxxxxxx-xxxxxxxxxxxxxxxx.xxxxxxx-01.azurewebsites.net/login' was loaded over HTTPS, but requested an insecure resource '[http://xxxxxxxxxxxx-xxxxxxxxxxxxxxxx.xxxxxxx-01.azurewebsites.net/auth/login]'. This request has been blocked; the content must be served over HTTPS.
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,095 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.