Skip to main content

point subdomain to local ip

Comments

5 comments

  • cPRex Jurassic Moderator

    Hey there!  While I can't say for sure, couldn't you just add another entry for the secure 443 vhost?

    0
  • Riza

    tried adding this to apache's pre-main together with the http one but it brings every domain/sub hosted with WHM goes down and unreacheable

    <VirtualHost 10.10.53.2:443>

        ServerName subdomain.example.com
        ServerAlias www.subdomain.example.com

        ProxyRequests Off
        ProxyPreserveHost On
        ProxyPass / https://192.168.226.10:443/
        ProxyPassReverse / https://192.168.226.10:443/

    </VirtualHost>

    0
  • cPRex Jurassic Moderator

    Since the entry is in the pre-main file, it could be catching all private traffic somehow, so maybe that isn't the best way to handle that.

    Have you created a cPanel account for this domain so there is a normal vhost in place?  If so, you may be able to customize that particular vhost with an include as outlined here:

    https://docs.cpanel.net/ea4/apache/modify-apache-virtual-hosts-with-include-files/

    but I'm just not sure cPanel is designed to handle this type of configuration without it causing problems for other sites.

    0
  • Riza

    i think i found the solution and it works

    <VirtualHost 10.90.53.2:443> 

        ServerName subdomain.example.com

        SSLEngine on 
        SSLProxyEngine On 
        SSLCertificateFile /var/cpanel/ssl/cpanel/mycpanel.pem
        SSLCertificateKeyFile /var/cpanel/ssl/cpanel/mycpanel.pem
     
        RequestHeader set X-HTTPS 1 
     
        ProxyPreserveHost On 
        ProxyPass / http://192.168.226.10/
        ProxyPassReverse / http://192.168.226.10/

    </VirtualHost>

    should i put it on post vhost include editor?

    0
  • cPRex Jurassic Moderator

    You're welcome to try, but you're in untested territory so you'll have to test it and see if it works how you expect.

    0

Please sign in to leave a comment.