Unable to access the NextCloud instance via HTTPS

Nextcloud version : 24.0.1
Operating system and version : Raspberry Pi Buster / Linux raspberrypi 5.10.103-v7l+
Apache or nginx version : Apache/2.4.38 (Raspbian)
PHP version : 7.4-fpm

The issue you are facing:
I am unable to access my NextCloud instance using HTTPS. I am able to do this just fine over HTTP.
The error I am getting is:
“Not Found. The requested URL was not found on this server. Apache/2.4.38 (Raspbian) Server at 192.168.0.103 Port 443”

I do have a Letsencrypt cert applied to the NextCloud instance. I am not interested at this time in making HTTPS access work over the internet but from my local network only.

Issue reproduction, HTTP vs HTTPS:

https://imgur.com/a/JQxvRRK

Is this the first time you’ve seen this error? (Y/N): Y

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

https://pastebin.com/iub4GGNi

Other files:

NextCloud instance .conf file for HTTP:

https://pastebin.com/bDNwrKDu

NextCloud instance .conf file for HTTPS:

https://pastebin.com/fRCe1zuP

Thanks,
Adrian

Maybe you can read some interesting parts of this installation guide. You can there change to version Debian 10. Mabe you missed something.

Thanks. I looked over the article. I already tried a lot of things so I am not sure what’s wrong.
My instance is located under /var/www/html/sitename. In the .config files the paths are pointing to /var/www/sitename. Could this be part of the issue? I’ve already tried modifying the paths to point to /www/html/ but it’s still not working. But why does it work over HTTP with the wrong path in the .config file for HTTP?

Regards,
Adrian

I think it is only a problem with your Apache2 Virtual host for HTTPS / TLS/SSL certificate.
Search in the internet the correct configuration for Apache2 SSL webserver.

Maybe there is only on path in the apache2 config wrong.

I was able to fix it on my own in the end. Here are the things I did:

  • I removed the .conf file for the SSL settings from under /etc/apache2/sites-enabled/
  • I added ServerName 172.0.0.1 to /etc/apache2/apache2.conf; it is 172.0.0.1 because this is what was configured under /etc/hosts (I had an extra entry for 172.0.0.1 folder_name_under /var/www/nextcloudfoldername)
  • removed the two .pem files and options-ssl-apache.conf file from under /etc/letsencrypt/live/domain_name/ and /etc/letsencrypt/
  • I added a ServerAlias domain_name entry to /etc/apache2/sites-available/main_conf_file_for_http.conf
  • ran certbot again and generated a new cert for my domain
  • https finally working! :smiley: