File nextcloud-apache-vhost.conf of Package nextcloud
# add the following modules to /etc/sysconfig/apache2:
#
# lbmethod_byrequests proxy proxy_balancer proxy_fastcgi slotmem_shm
#
<VirtualHost _default_:80>
ServerName cloud.example.com
Redirect permanent / https://cloud.example.com/
</VirtualHost>
<IfDefine SSL>
<IfDefine !NOSSL>
<VirtualHost _default_:443>
<IfModule mod_apparmor.c>
AADefaultHatName cryptomilk.cloud
</IfModule>
ServerName cloud.example.com:443
ServerAdmin webmaster@example.com
DocumentRoot "/srv/www/vhosts/nextcloud/public"
ErrorLog /var/log/apache2/cloud.example.com-error_log
TransferLog /var/log/apache2/cloud.example.com-access_log
<IfModule mod_headers.c>
Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>
<Directory "/srv/www/vhosts/nextcloud/public">
Options -Indexes +FollowSymLinks
<IfModule mod_dav.c>
Dav off
</IfModule>
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php
# Redirect to the php-fpm proxy
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/php-nextcloud-fpm.sock|fcgi://localhost/"
</FilesMatch>
SSLEngine On
SSLUseStapling On
SSLCertificateFile /etc/ssl/letsencrypt/example.com/cert.pem
SSLCertificateKeyFile /etc/ssl/letsencrypt/example.com/privkey.pem
SSLCertificateChainFile /etc/ssl/letsencrypt/example.com/chain.pem
</VirtualHost>
</IfDefine>
</IfDefine>