It could harden a bit the project using BasicAuth for api.php access, thus denying automatically attempts to hack the server without proper authentication.
I don't know if it's a portable idea or not, since I'm not sure nginx allows BasicAuth configuration in a file like .htaccess.