Nextcloud ocm-provider resolve error

I would like assistance with something that happens lately.

Default Nextcloud installation on my RPi 4 running DietPi v8.25.1 on Lighttpd and i have the following error in the “Security & setup warnings” tab in Nextcloud:

Your web server is not properly set up to resolve "/nextcloud/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.

Nextcloud updated fine and running Nextcloud Hub 6 (27.1.5) version.

My /var/www/nextcloud/.htaccess file regarding the ocm-provider settings are as follows:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^ocm-provider/?$ index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

Thank you

best to my knowledge Lighttpd don’t use a .htaccess file. Probably @MichaIng knows it better than I.

Yes, correct, lighttp does not support .htaccess.
I use also lighttpd and Nextloud (but I’m on version 28.0.1) and I have not such an error.

The corresponding config file is at /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf which has two lines for rewrites, one is for ocm provider:

	# Rewrites
	url.rewrite-once += (
		"^/nextcloud/remote/(.*)" => "/nextcloud/remote.php/$1",
		"^/nextcloud/ocm-provider($|/\?.*)" => "/nextcloud/index.php$1"
	)

Maybe it’s also worth to mentioned that I don’t run it on a subdomain, just a path like mydomain.com/nextcloud

1 Like

Hmm maybe then they have messed up something in Nextcloud and shows that error that it is actually means or affects nothing in my setup?

I checked the /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf file and the are no Rewrites, only this seems relevant:

# Redirect OCM/OCS provider requests to Nextcloud endpoint:
url.redirect += (
        "^/.well-known/webfinger" => "/nextcloud/index.php/.well-known/webfinger",
        "^/.well-known/nodeinfo" => "/nextcloud/index.php/.well-known/nodeinfo"
)

Also i am still in v27.1.5 cause i am waiting for v28 to be offered naturally for upgrade.

I found this:

Since 27.1.2 and 26.0.8 ocm-provider is not a dir anymore, but implemented in a usual Controller.

So before there was a folder in your nextcloud dir, but since the update the folder is removed and the feature is implemented as a controller, thus the rewrite is needed.

Probably you don’t need it if you don’t use OCM features.

Please try the new config. We did quite a bunch of changes with DietPi v8.24 and v8.25 to the Lighttpd Nextcloud config:

curl -sSfo /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.conf/dps_114/lighttpd.nextcloud.conf'

We should update this config file with next DietPi update for everyone. I’ll do a commit for this.

EDIT: This should do it: v9.0 · MichaIng/DietPi@49d0886 · GitHub
I also changed the behaviour of reinstalls, to always install the new configs, and we will update them via dietpi-update whenever important changes are done from now one. There are also security-relevant changes by times, and sometimes mandatory ones, like for the newly used mjs files in Nextcloud.

2 Likes

Thank you all, indeed i didn’t have the updated .conf file.

After updating as @MichaIng suggested, everything seem to work normal :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.