Data folder and .htaccess accessibility issue on Nextcloud after update

Hello everyone,

I’m experiencing configuration issues on my Nextcloud instance and I need your help. Here are the details:

Problem description:
Since the last Nextcloud update, my instance reports that the data folder and files are probably accessible from the internet, and that the .htaccess file is not working. The error message is as follows:

Your data directory and files are probably accessible from the internet. The .htaccess file does not work. We strongly recommend that you configure your web server so that your data directory is no longer accessible or move it out of the web server root.

Server configuration:

  • OS: Ubuntu
  • Web Server: Apache
  • Nextcloud version: Nextcloud Hub 8 (29.0.3)

Steps taken so far:

  1. Verified that the .htaccess files are present and have the correct permissions.
  2. Enabled mod_rewrite and mod_headers modules.
  3. Configured AllowOverride All in the relevant sections of Apache configuration files to allow the use of .htaccess files.
  4. Restarted Apache after each change.
  5. Used curl to check the accessibility of the data directory via HTTPS, which returns a 404 HTTP code (which seems correct).

Questions:

  1. What can I check or modify to resolve this issue?
  2. Are there specific configurations for Nextcloud that I should be aware of?
  3. Has anyone else encountered this issue and how did they resolve it?

Thank you in advance for your help!