<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName apostas.jcwebsoftware.cloud
    
    # CORREÇÃO: DocumentRoot deve apontar para o diretório public do Laravel
    DocumentRoot /var/www/html/apostas/public

    <Directory /var/www/html/apostas/public>
        AllowOverride All
        Require all granted
        Options -Indexes +FollowSymLinks
    </Directory>

    # Permite acesso ao diretório raiz para arquivos de configuração se necessário
    <Directory /var/www/html/apostas>
        AllowOverride All
        Require all granted
        Options -Indexes
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/apostas_error.log
    CustomLog ${APACHE_LOG_DIR}/apostas_access.log combined

    RewriteEngine on

    # Some rewrite rules in this file were disabled on your HTTPS site,
    # because they have the potential to create redirection loops.

    # RewriteCond %{SERVER_NAME} =apostas.jcwebsoftware.cloud
    # RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

    SSLCertificateFile /etc/letsencrypt/live/apostas.jcwebsoftware.cloud/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/apostas.jcwebsoftware.cloud/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

