<VirtualHost *:443>
# RICORDATI DI ABILITARE I MODULI proxy_wstunnel    proxy_http proxy_load   proxy_conf  wsgi_load   wsgi_conf
    ServerAdmin webmaster@realtime.local
    ServerName realtime.local

    DocumentRoot /var/www/html/realtime

    # Configura il Proxy verso Node.js per WebSocket
    #ProxyPass /node/ ws://localhost:3000/
    #ProxyPassReverse /node/ ws://localhost:3000/
    ProxyPass /node/ wss://127.0.0.1:3000/
    ProxyPassReverse /node/ wss://127.0.0.1:3000/

    <Directory /var/www/html/realtime>
        AllowOverride All
        Require all granted
    </Directory>

    # Configurazione SSL per Apache
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/realtime.local.crt
    SSLCertificateKeyFile /etc/ssl/private/realtime.local.key

    # Abilita il Proxy SSL
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off

    ErrorLog ${APACHE_LOG_DIR}/realtime_error.log
    CustomLog ${APACHE_LOG_DIR}/realtime_access.log combined
</VirtualHost>