Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
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.
Hi there @fabdarice,
There are a couple of solutions that I could suggest:
What you could do is set up Nginx as a reverse proxy and proxy the traffic from your_public_ip/api to http://localhost:5000/, that way the 5000 port would not have to be exposed externally.
Then you will need to configure your React app so it connects to your_public_ip/api instead of `http://localhost:5000/.
http://your_public_ip:5000 instead of http://127.0.0.1:5000/It sounds like that in your React app you’ve specified your Flask URL as http://127.0.0.1:5000/, so when you access the React app via your browser, it tries to connect to port 5000 on your PC rather than the server IP address.
To fix that without Nginx proxy, you need to change the reference to your Flask app in your React app so that it points to http://your_public_ip:5000 instead of http://127.0.0.1:5000/. And as you mentioned make sure that Flask is binding on 0.0.0.0 rather than localhost.
Also, can you try running the following command to make sure that both services are listening as expected on the correct ports:
- sudo netstat -plant
Let me know how it goes! Regards, Bobby