En mi sitio web tengo dos aplicaciones escritas en Vue. El primero es SPA en el puerto 80, el segundo es Nuxt SSR en el puerto 8080, que se redirige desde localhost:8000. Logré configurar HTTPS en ambos puertos externos, pero solo en el puerto 80, el tráfico HTTP se redirige a HTTPS. En el puerto 8080 HTTPS funciona, pero cuando trato de visitar el sitio con http:// me da el error de Apache Bad Requetst:
"Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please."
Quiero que todo el tráfico del puerto 8080 se redirija a HTTPS.
Mi sitio.conf:
<VirtualHost *:443> ServerName site.com SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 Protocols h2 http/1.1 SSLEngine On SSLCertificateFile cert_path... SSLCertificateKeyFile key_path... SSLCertificateChainFile cert_path... ... </VirtualHost> <VirtualHost *:80> ... RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] ... </VirtualHost> <VirtualHost *:8080> ... SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 Protocols h2 http/1.1 SSLEngine On SSLCertificateFile cert_path... SSLCertificateKeyFile key_path... SSLCertificateChainFile cert_path... ProxyPreserveHost On ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/ RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}:8080/$1 [R,L] </VirtualHost>