Sync client not connecting, possible proxy configuration issues

I’m running the nexcloud snap on Ubuntu 16.04. I have it configured to run on port 8080, with an nginx reverse proxy so it’s accessible at https://my.domain/nextcloud/.
Visiting https://my.domain/nextcloud/ redirects me to https://my.domain/nextcloud/index.php/login, where I can log in and use the web interface. However, if I try to access https://my.domain/nextcloud/remote.php or https://my.domain/nextcloud/status.php, I get a 404 (and hence the sync client cannot connect).

This was working at one point, so perhaps a recent change to the snap requires me to change some configuration? I have linked the relevant parts of my nginx and nextcloud config.

Any help would be appreciated!

I resolved the issue, it’s because nginx is also serving PHP files via fastcgi. The location ~ \.php$ line was confusing nginx as was matching this after matching location /nextcloud. Changing it to location ^~ /nextcloud prevents it carrying on after matching the nextcloud subdirectory, which fixes the problem.