<VirtualHost 65.108.222.97:80>
    ServerName ${MIODOMINIO_COMPLETO}
    RewriteEngine On

    # Forza la connessione HTTPS
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://${MIODOMINIO_COMPLETO}%{REQUEST_URI} [L,R=301]
</VirtualHost>

<VirtualHost 65.108.222.97:443>
  ServerName ${MIODOMINIO_COMPLETO}
  DocumentRoot /var/www/${MIODOMINIO_COMPLETO}
  ServerAdmin surya@riso.app
  SSLEngine On
  SSLProtocol -ALL +TLSv1.2
  SSLCompression Off
  SSLHonorCipherOrder off
  SSLCipherSuite ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128
  SSLVerifyDepth 10
  SSLCertificateFile /etc/letsencrypt/live/${MIODOMINIO}/cert.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/${MIODOMINIO}/privkey.pem
  <Directory /var/www/${MIODOMINIO_COMPLETO}/>
    CGIPassAuth On
    Require all granted
    AllowOverride All
  </Directory>
  LogLevel warn
  ErrorLog "/var/www/${MIODOMINIO_COMPLETO}/logs/error.log"
  CustomLog "/var/www/${MIODOMINIO_COMPLETO}/logs/access.log" combined
</VirtualHost>