Rewrites exist, but the overview page says they are not set up

Nextcloud version : 24.0.4.RC1
Operating system and version : Ubuntu Server 22.04 x86_64
Apache or nginx version : Apache 2.4.52
PHP-FPM version : 8.1
HAProxy version : 2.7-dev2-2f2a28-86 2022/08/06

HAProxy is the Internet-facing software providing TLS, using unencrypted HTTP/2 to the Apache backend.

The issue you are facing:

I had the rewrites configured in the Apache virtualhost, and I have verified that they work, but I was getting four warnings on the overview page:

* Your web server is not properly set up to resolve "/.well-known/webfinger". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/24/go.php?to=admin-setup-well-known-URL).
* Your web server is not properly set up to resolve "/.well-known/nodeinfo". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/24/go.php?to=admin-setup-well-known-URL).
* Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/24/go.php?to=admin-setup-well-known-URL).
* Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/24/go.php?to=admin-setup-well-known-URL).

If I move the rewrites to .htaccess, then the warnings for carddav and caldav go away, and I am left with warnings for webfinger and nodeinfo. The URL that it redirects to in both cases returns a 404. Looks to me like either Apache or PHP don’t like dealing with URLs that have stuff after index.php starting with a slash. And apparently the validation doesn’t work right if the rules are in the virtualhost rather than .htaccess.

These are the rewrites that I now have in the .htaccess:

  RewriteRule ^/\.well-known/carddav https://%{HTTP_HOST}/remote.php/dav [R=301,L]
  RewriteRule ^/\.well-known/caldav https://%{HTTP_HOST}/remote.php/dav [R=301,L]
  RewriteRule ^/\.well-known/webfinger https://%{HTTP_HOST}/index.php/.well-known/webfinger [R=301,L]
  RewriteRule ^/\.well-known/nodeinfo https://%{HTTP_HOST}/index.php/.well-known/nodeinfo [R=301,L]

The output of your Nextcloud log in Admin > Logging:

There is a LOT here but none of it looks relevant.
If there is something specific I should be looking for,
please let me know.

I found nothing relevant in the webserver log.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'allow_local_remote_servers' => true,
  'default_phone_region' => 'US',
  'config_is_read_only' => false,
  'instanceid' => 'REDACTED_INSTANCE_ID',
  'passwordsalt' => 'REDACTED_SALT',
  'secret' => 'REDACTED_SECRET',
  'trusted_domains' => 
  array (
    0 => 'REDACTED_DOMAIN',
  ),
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
  ),
  'datadirectory' => '/storage0/nextcloud',
  'dbtype' => 'mysql',
  'version' => '24.0.4.0',
  'overwrite.cli.url' => 'https://REDACTED_DOMAIN',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_elyograg',
  'dbpassword' => 'REDACTED_DB_PASSWORD',
  'installed' => true,
  'maintenance' => false,
  'loglevel' => 0,
  'theme' => '',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'REDACTED_SMTP_HOST',
  'mail_smtpport' => '587',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'REDACTED_DOMAIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'REDACTED_SMTP_USER',
  'mail_smtppassword' => 'REDACTED_SMTP_PASSWORD',
  'updater.release.channel' => 'beta',
  'updater.secret' => 'REDACTED_SECRET',
  'memcache.local' => '\OC\Memcache\Memcached',
  'memcache.distributed' => '\OC\Memcache\Memcached',
  'memcached_servers' => [
    [ 'localhost', 11211 ],
  ],
);

Everything has worked correctly for me despite those warnings, but I would like to resolve them.

When I first moved the rewrites to .htaccess, it got rid of two of the warnings. But now all four warnings display again, and as far as I can tell, nothing else has changed.

I can’t figure out what the problem is. I have defined rewrites, but the admin overview still says they are not present.

Today I upgraded to 25.0.0 beta2, still have the problem.

I’m having the same problem since setting up a new server with 24.0.4 and php 8.1.9.
All my settings in virtualhost files and .htaccess files are the same except things like servername and document root.
I’ve checked and double checked over 4 nights just in-case of a typo or similar error but to no avail. I’m beginning to suspect it may be a php8.x problem and that Nextcloud isn’t ready for php 8x

I had big problems with PHP 8.1 as well. Got around those by copying the site and database to another server I have that still has PHP 7.4, upgrading it there to version 24, and then copying it all back to he original server.

As for this problem, the two rewrites for DAV urls are working if I try them manually, so I do not know why the check is failing. The webfinger and nodeinfo rewrites are probably working, but the URLs that each of those rewrite to is returning a 404.