-1

I have 2 different domains my.domain1.com and my.domain2.com and both have context name /app1 and this should be routed to two different backend boxes.

Problem here is my.domain1.com is running on VirtualHost _default_:443 and routing /app1 for internal01 server. Now i need to configure my.domain2.com to route /app1 requests to internal02 server. Is there option for conditional proxying based domain name.

Please let me know best way to implement this.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
krish3
  • 1
  • 1

1 Answers1

0

Unless I am missing something from your description, you are basically just describing using virtual hosts. In that case, I would probably set up segments such as the following (I've included a sensible SSL configuration as you've mentioned your current setup is running on port 443)

<VirtualHost _default_:443>
    ServerAlias my.domain1.com
    ProxyPreserveHost on

    <location />
          allow from all
    </location>

    ProxyPass /app1 http://internal01/
    ProxyPassReverse /app1 http://internal01/

    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:HIGH:!aNULL:!MD5:!DSS
    SSLHonorCipherOrder on

    SSLCertificateFile /etc/pki/tls/certs/certfordomain1.crt
    SSLCertificateKeyFile /etc/pki/tls/private/privatekeyfordomain1.key
    SSLCertificateChainFile /etc/pki/tls/certs/chain.pem
    SSLCACertificateFile /etc/pki/tls/certs/ca.pem
</VirtualHost>

and for the second host:

<VirtualHost _default_:443>
    ServerAlias my.domain2.com
    ProxyPreserveHost on

    <location />
          allow from all
    </location>

    ProxyPass /app1 http://internal02/
    ProxyPassReverse /app1 http://internal02/

    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:HIGH:!aNULL:!MD5:!DSS
    SSLHonorCipherOrder on

    SSLCertificateFile /etc/pki/tls/certs/certfordomain2.crt
    SSLCertificateKeyFile /etc/pki/tls/private/privatekeyfordomain2.key
    SSLCertificateChainFile /etc/pki/tls/certs/chain.pem
    SSLCACertificateFile /etc/pki/tls/certs/ca.pem
</VirtualHost>

Hope this helps!

BE77Y
  • 2,667
  • 3
  • 18
  • 23