I want to update records in a database through an api.php. I do this by sending GET requests to the API on the server from another particular server.
I tried limiting CORS to only that specific server, but GET requests were still accepted from the browser. I also tried to set a condition to match the server's IP with the one specified in the API and abort if it's false. However, I fear that this is an imprudent move as I am not that experienced in these types of situations.
Can I safely limit the api to allow GET requests only from this specific server address?
System architecture
- Webserver: Nginx
- App language: php(5.3), javascript, html, css
- Database: Mysql