OJS does not always respect the disable_path_info setting causing 404s

I have a NGINX setup so have
disable_path_info set = On
which has worked fine for OJS 2 but for OJS 3.

I’m getting unexpected errors popups and the issue is AJAX requests not being sent as an index.php

This request is being sent


This should be

The /EXAMPLE/api/v1/_submissions is being added erroneously despite the
disable_path_info = On

How can I fix this? I don’t mind going into the code if necessary.