My company uses a CMS system hosted in the cloud. We want to create internally DNS-aliases to make it easier for developers to remember.
If your developers can't follow the link you provide them with and can't create a bookmark when it's too difficult to remember I'd worry about that...
I also think you are probably thinking too technical and DIY ; I'd start by contacting the CMS provider and state that you want to use your own domain to access the CMS. They can probably (re)configure their service so that it works with your preferred domain and associated TLS certificate.
Then the only config you need to maintain on your side is the DNS CNAME record to points test-cms.example.com. to mycorp-xpqa-lb-8qh7ip0n.cms.cloud.
Now back to your Apache config.
mod_proxy_connect is only needed for a forward HTTPS proxy, you're setting up a reverse proxy and don't need AllowCONNECT
.
Your reverse proxy also needs its own TLS certificate, which is missing in your code.
Often mapping different URL paths in a reverse proxy, /
to /mycorp
, leads to incompatibilities, as do unbalanced trailing slashes.
Consider this instead:
RedirectMatch ^/$ /mycorp
ProxyPass / https://mycorp-xpqa-lb-8qh7ip0n.cms.cloud/
ProxyPassReverse / https://mycorp-xpqa-lb-8qh7ip0n.cms.cloud/
That redirects requests for the root, the bare subdomain to the correct sub directory and also insures to for instance content from shared, not company specific, directories such as https://mycorp-xpqa-lb-8qh7ip0n.cms.cloud/common
will remain available.
<VirtualHost *:443>
ServerName test-cms.example.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/test-cms.example.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/test-cms.example.com.key
RedirectMatch ^/$ /mycorp
SSLProxyEngine on
ProxyPass / https://mycorp-xpqa-lb-8qh7ip0n.cms.cloud/
ProxyPassReverse / https://mycorp-xpqa-lb-8qh7ip0n.cms.cloud/
</VirtualHost>
Any sufficiently advanced security configuration on the side of the CMS may still detect that an unknown domain name is used and subsequently deny access.