Redirigir a URI con Apache2 como proxy inverso

Redirigir a URI con Apache2 como proxy inverso

Estoy ejecutando un proxy inverso usando Apache2 y tengo configurado el siguiente vHost:

<VirtualHost *:80>
        ServerName rds.example.com
        Redirect / https://rds.example.com/RDWeb/
</VirtualHost>
<VirtualHost *:443>
        # Proxy
        ServerName rds.example.com
        ProxyPreserveHost on
        SSLProxyEngine on
        SSLProxyVerify off
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off
        SSLProxyCheckPeerExpire off
        ProxyPass / https://backend01.example.com/
        ProxyPassReverse / https://backend01.example.com/
SSLCertificateFile /etc/letsencrypt/live/rds.example.com//fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/rds.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

Cuando un cliente se conecta ahttp://rds.ejemplo.comohttps://rds.ejemplo.com, Quiero redirigirlo a https.//rds.example.com/RDWeb (los servicios web de escritorio remoto predeterminados de Microsoft).

En realidad, cuando un cliente se conecta, sólo se le redirige ahttps://rds.ejemplo.comcon la hermosa página de IIS.

Qué estoy haciendo mal ?

Respuesta1

Puede utilizarlo mod_rewritepara redirigir a donde desee; integre esto en el servidor virtual SSL:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /RDWeb/ [R,L]

No olvide habilitar mod_rewrite (úselo a2enmodsi es posible).

información relacionada