I am running an Ubuntu server (DigitalOcean droplet) with 2 services. React (Create React App) frontend in PORT 3000 and Node.js backend/API in PORT 8765 with PM2(pm2.keymetrics.io).
Screenshot of PM2 running 2 services
The ports are open (3000 and 8765). I checked.
lsof command showing the open ports
Problem: When the frontend app (in my browser) tries to access the backend it returns the '503 Service Unavailable' status code.
Screeshot of the browser developer tools showing 503
Question: What could be the reason? Can you suggest any steps to try?
Note: It worked fine during the past few weeks. (I used to pull the new changes from the Bitbucket) But today I got this issue.
What I have tried so far
- Restart the server. Same error.
- Change the Backend port from 9000 to 8765
- Run the same code in a fresh AWS EC2 instance. There it works fine.
- Force to listen on IPv4 (based on @adel comment) Screenshot using IPv4