0

In httpd.conf, I have

NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName *.aonesalons.com
        ProxyPreserveHost On
        # setup the proxy
        <Proxy *>
            Order allow,deny
            Allow from all
        </Proxy>
        ProxyPass / http://localhost:9000/
        ProxyPassReverse / http://localhost:9000/
    </VirtualHost>

    <VirtualHost *:80>
        ServerName backend.aonesalons.com
        ProxyPreserveHost On
        # setup the proxy
        <Proxy *>
            Order allow,deny
            Allow from all
        </Proxy>
        ProxyPass / http://localhost:11000/
        ProxyPassReverse / http://localhost:11000/
    </VirtualHost>

I intend that requests to all subdomains to go this server be routed to 9000 port except for backend.aonesalons.com which should go to 11000 port.

I tried to make an exception using above rule.

Everything is being routed to port 9000 well. But backend.aonesalons.com is not working.

How do we fix this?

Edit:

<VirtualHost backend.aonesalons.com:80>
    ServerName backend.aonesalons.com
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:11000/
    ProxyPassReverse / http://localhost:11000/
</VirtualHost>

<VirtualHost *:80>
    ServerName *.aonesalons.com
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:9000/
    ProxyPassReverse / http://localhost:9000/
</VirtualHost>

I still get 404 for this

systemdebt
  • 4,589
  • 10
  • 55
  • 116

1 Answers1

0

Try replacing the with servername included:

<VirtualHost backend.aonesalons.com:80>

this should work, not tested. Apply this change to both entries. I'm not sure about the order - properly the *.domain.de last because it will be handled then and the config is not read further more

Felix Gaebler
  • 702
  • 4
  • 23