Skip to content

Fix Nextcloud Upgrade Error: “OCS provider resolving” on Enhance with LiteSpeed Enterprise

Fix Nextcloud Upgrade Error: “OCS provider resolving” on Enhance with LiteSpeed Enterprise

If a Nextcloud upgrade refuses to proceed and shows:

OCS provider resolving Your web server is not properly set up to resolve "/ocs-provider/"

This is not a Nextcloud “update issue”.

It’s a routing issue: your server is sending requests for /ocs-provider/ into Nextcloud’s front controller instead of serving the real folder directly.

The result is typically:

  • https://your-domain/ocs-provider/index.php returns 200
  • https://your-domain/ocs-provider/ returns 404

That mismatch blocks the upgrade.


What you will achieve

  • Make https://your-domain/ocs-provider/ resolve correctly (no 404)
  • Clear the upgrade blocker
  • Keep your Nextcloud routing stable on LiteSpeed Enterprise

Estimated time

5 to 10 minutes.


Access needed

  • SSH access to the server or the site user
  • Ability to edit Nextcloud .htaccess

GOZEN HOST note

If you want this handled end-to-end, open a ticket and we’ll validate the LiteSpeed behavior, Nextcloud rewrite rules, and your upgrade path cleanly.


Tell it like it is

This issue is usually a LiteSpeed rewrite edge case, not “bad Nextcloud”. You can fix it safely, but you should backup .htaccess first.


Step 1: Confirm the exact symptom

Run these from your local machine or the server:

curl -I https://your-domain/status.php
curl -I https://your-domain/ocs-provider/index.php
curl -I https://your-domain/ocs-provider/
curl -I https://your-domain/ocm-provider/

Expected interpretation

  • status.php should be 200 If it is not, your domain may be pointing at the wrong document root.

  • ocs-provider/index.php should be 200 This confirms the folder exists and PHP is working.

  • ocs-provider/ returning 404 is the blocker This usually means LiteSpeed is rewriting /ocs-provider/ into Nextcloud instead of serving the folder directly.

  • ocm-provider/ is not the main test here On many Nextcloud versions it resolves via routing and can still be 200 even while /ocs-provider/ is broken.


Step 2: Set correct Nextcloud values (webroot install)

If Nextcloud is installed in the webroot (for example public_html), confirm these in config/config.php:

'htaccess.RewriteBase' => '/',
'overwrite.cli.url' => 'https://your-domain/',

Trailing slash on overwrite.cli.url is recommended for consistency with CLI-generated URLs.


Step 3: Refresh Nextcloud rewrite rules

From the Nextcloud root folder (your public_html):

cd /path/to/public_html
sudo -u YOURWEBUSER php occ maintenance:update:htaccess

This regenerates the shipped .htaccess rules Nextcloud expects.


Step 4: Backup and patch the LiteSpeed rewrite edge case

4.1 Backup .htaccess

cd /path/to/public_html
cp -a .htaccess .htaccess.bak.$(date +%F-%H%M%S)

4.2 Patch the condition that excludes ocs-provider

On LiteSpeed Enterprise, a common failure mode is that the .htaccess exclusion matches only one directory form. The fix is to allow an optional trailing slash:

cd /path/to/public_html

# Patch common Nextcloud variants (safe if one of them does not match)
sed -i 's@RewriteCond %{REQUEST_FILENAME} !/(ocs-provider|updater)/@RewriteCond %{REQUEST_FILENAME} !/(ocs-provider|updater)/?@' .htaccess
sed -i 's@RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/@RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/?@' .htaccess

Option B: Patch manually (if you prefer to review first)

Find the line:

RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/

Change it to:

RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/?

Same idea if your file has a shorter variant without ocm-provider.


Step 5: Restart LiteSpeed cleanly

If you manage LiteSpeed via WebAdmin, do a Graceful Restart.

If you manage it via systemd:

sudo systemctl restart lsws

If your service name differs:

systemctl list-units --type=service | grep -i litespeed

Step 6: Verify the fix

Re-run:

curl -I https://your-domain/ocs-provider/ | head -n 1

Success looks like:

  • HTTP 200 (or anything that is not 404)

If it still returns 404, also check whether it’s a Nextcloud 404 (cookies like oc_sessionPassphrase are a giveaway). If it is, your rewrite is still catching the request and the .htaccess patch was not applied or got overwritten.


Troubleshooting

“I patched it but it came back after an upgrade”

Some upgrades can regenerate .htaccess. Keep your backup and re-apply the same patch after the update if needed.

“ocs-provider/index.php is 200 but /ocs-provider/ is 404”

That is almost always this exact rewrite edge case. Re-check Step 4 and confirm the /? exists in the exclusion condition.


Summary

When Nextcloud upgrade checks fail with “OCS provider resolving” on Enhance + LiteSpeed Enterprise, the core fix is:

  1. Confirm the endpoint mismatch
  2. Regenerate Nextcloud .htaccess
  3. Patch the REQUEST_FILENAME exclusion to handle both directory forms
  4. Restart LiteSpeed
  5. Re-test /ocs-provider/