<VirtualHost *:80>
    ServerName beta.sltdigitalweb.lk

    # DocumentRoot should point to the 'build' directory of your Vite project
    DocumentRoot /home/betasltdigitalwe/public_html

    <Directory /home/betasltdigitalwe/public_html>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

# Ensure SSL is enabled
<VirtualHost *:443>
    ServerName beta.sltdigitalweb.lk

    SSLEngine on
    SSLCertificateFile /etc/apache2/conf.d/ssl.crt/fullchain.pem
    SSLCertificateKeyFile /etc/apache2/conf.d/ssl.key/privkey.pem
    SSLCACertificateFile /etc/apache2/conf.d/ssl.crt/chain.pem  # Optional

    # ProxyPass configuration to handle the backend
    ProxyPass /blogs http://172.17.0.2:3000
    ProxyPassReverse /blogs http://172.17.0.2:3000

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

