Let’s say I have a web app developed using react for the frontend and django rest framework for the backend. Let’s assume that the frontend is hosted on 192.168.1.100:3000 and the backend on 192.168.1.100:4000. Now on the host pc accessing both directly is fine and functionality works fine but on the local pc although the functionality works fine I want the direct access to the backend IP to be blocked, so user’s on other local pcs will only be able to access the backend through the frontend if that makes sense.
However, it doesn’t work at all and if I block the backend, sending requests wont work for other local pcs and if I unblock it, it will work fine but they have direct access to the backend server through the browser. Is there a way to have it so that if they write the IP in the browser, it will block them from accessing it but If they go to the frontend and make a POST request for example, it will work fine without causing an error?
Devman22 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.