ProxyPass all subdomains for a given domain to another

Discussion in 'Apache' started by P-Y, Jan 30, 2009.

  1. #1
    Hello,

    I would like to use Apache reverse proxies to forward all subdomains for a given domain to another domain. Is it possible?

    Here's my current configuration for reverse proxies:


    
    <VirtualHost *:80>
            ServerName aaa.sourceserver.com
            ProxyPass / http://aaa.destinationserver.com/
            ProxyPassReverse / http://aaa.destinationserver.com/
            ProxyPreserveHost On
    </VirtualHost>
    <VirtualHost *:80>
            ServerName bbb.sourceserver.com
            ProxyPass / http://bbb.destinationserver.com/
            ProxyPassReverse / http://bbb.destinationserver.com/
            ProxyPreserveHost On
    </VirtualHost>
    
    (etc...)
    
    Code (markup):
    Since there are hundreds of these subdomains, I would like to know what I could use in configuration file so ALL subdomains from sourceserver.com are forwarded to the same subdomain on destinationserver.com. Something like:

    
    <VirtualHost *:80>
            ServerName *.sourceserver.com
            ProxyPass / http://*.destinationserver.com/
            ProxyPassReverse / http://*.destinationserver.com/
            ProxyPreserveHost On
    </VirtualHost>
    
    Code (markup):
    (This code is not valid, but you get my point...)

    Thanks for reading! Any help is welcome!
     
    P-Y, Jan 30, 2009 IP
  2. ecommy

    ecommy Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have you solved your issue? I have the same problem. Thank you!
     
    ecommy, Jul 17, 2012 IP