Good morning
I have a big problem with Letsencrypt and the HTTPS redirection. They doesn’t work.
000-default.conf
<VirtualHost *:80>
ServerAdmin sascha@localhost
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
# RewriteCond %{SERVER_NAME} =nextcloud.xxxxxx.at
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName nextcloud.xxxxxx.at
SSLCertificateFile /etc/letsencrypt/live/nextcloud.sptech.at/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.sptech.at/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
Can someone tell me what I did wrong? I use Letsencrypt as certificate. The certificate works.
To create the certificate I used the following command:
./letsencrypt-auto -d nextcloud.xxxxxx.at --redirect --apache -m my_email_address
When I type my url without https I get only an error like this