Hi Shreepad,
Many customers deploying multicontainer applications with a React frontend and Node.js backend report seeing the "CANNOT GET /" error on Azure, even if everything works smoothly in their local environment. This issue is commonly linked to a few key deployment settings. Here’s what to check:
Server Configuration: Often, the server isn't set up to serve static files correctly. Ensure that your web server (like Nginx or Apache) is configured to point to the correct location for your React build files.
Dockerfile Accuracy: Misconfigured Dockerfiles are another frequent cause. Verify that your frontend Dockerfile builds and copies files to the correct directory. Ensure that both your frontend and backend containers are networked and communicating properly.
Port Mapping: Double-check that the frontend container’s port is correctly mapped and that your application is listening on the expected environment port on Azure.
Azure App Service Configurations: When using a docker-compose.yml
file, customers often overlook correct paths and networking. Confirm that your start
scripts or CMD
commands target the app’s correct entry points.
React Router Fallback (if using client-side routing): If your React app uses client-side routing, a common fix is to add a fallback route in the server configuration to serve index.html
on unknown routes, ensuring proper routing.
If this sounds familiar, or if you have any specific error logs, I’d be happy to help with further troubleshooting!