Nextcloud: Server not set up to resolve: ocm-provider

You need to route ocm-provider requests to index.php to have the error go away. The error started showing after I upgraded my Nextcloud server some time ago, and I have not had time to fix it until now.


By. Jacob

Edited: 2023-10-29 19:38

Your web server is not properly set up to resolve "/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it's documentation page ↗. On Nginx those are typically the lines starting with "location ~" that need an update.

I have previously dealt with redirect issues in my Nextcloud setup, so when I, this time, encountered an issue with ocm-provider I was actually quite annoyed. This is another reason why I prefer to route everything through index.php from the start, as you will avoid such issues almost entirely.

I learned the reason why it was now complaining about the ocm-provider thing was simply because the directory did not exist in the Nextcloud root folder – no amount of redirects is going to fix it when the directory does not exist! Again, later I learned you should just route it to Nextcloud's index.php – but man, this was an irritating waste of time to deal with.

To fix it, you should instead update to Nextcloud 27.1.3+, as the problem may have been fixed in 27.1.3.

However, even after updating I was still having the issue, so I was back at messing with my redirects and server configuration; adding the following to my Apache v-host seems to have finally fixed the issue:

RewriteRule ^ocm-provider/(.*) /index.php [QSA,L]

Remember to also reload your Apache configuration:

sudo service apache2 reload

The problem is also discussed at GitHub.

Tell us what you think:

  1. The Nextcloud notes app is worth using, because it stores notes in a logical and natural way, secures your notes and ensures you will never lose access to them.
  2. This can happen when the Redis environment is configured incorrectly, and/or when the redis-server.sock file has the wrong permissions.
  3. How to toggle maintenance mode on or off for your Nextcloud server
  4. Prevent your Nextcloud data directory from being accessible from the internet.

More in: Nextcloud