Apache rewrite rule issue

Hi,

I am running a Nextcloud instance using apache and php-fpm. When I look at the Nextcloud setting overview, I always get this message:

1633110818398.png

In order to fix it, I created a rewrite rule in my vhost but I still get the error:
Code:
<VirtualHost *:80>
    DocumentRoot "/usr/local/www/nextcloud"
    ServerName cloud.mynextcloud.uk
    <FilesMatch \.php$>
        SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
    DirectoryIndex /index.php index.php
    <Directory /usr/local/www/nextcloud>
       Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews

       <IfModule mod_dav.c>
            Dav off
        </IfModule>

        RewriteEngine on
        RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
        RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
        RewriteRule ^/\.well-known/host-meta https://%{SERVER_NAME}/public.php?service=host-meta [QSA,L]
        RewriteRule ^/\.well-known/host-meta\.json https://%{SERVER_NAME}/public.php?service=host-meta-json [QSA,L]
        RewriteRule ^/\.well-known/webfinger https://%{SERVER_NAME}/public.php?service=webfinger [QSA,L]

    </Directory>
</VirtualHost>
Could anyone provide any advise on how to fix this warning please?

Thank you
 
How is anyone supposed to follow links in a picture?
Good point sorry.
Here is the text
---

Security & setup warnings​

It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.

There are some warnings regarding your setup.
  • Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation ↗.
  • Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation ↗.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

Check the security of your Nextcloud over our security scan ↗.
 
Code:
RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L] 
RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
Documentation says to use:
Code:
  RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]

Notice the difference? It does assume you have a /nextcloud subfolder, if I look at your setup it looks like you haven't used a subfolder. So then it should be:
Code:
  RewriteRule ^\.well-known/carddav /remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav [R=301,L]
 
Back
Top