I'm using mod_proxy to redirect requests of several sub domains of main one to corresponded servers running on the LAN. Long story short here is my config:

ProxyRequests off
<VirtualHost 0.0.0.0:80>
    ServerName sub1.dev.enterprise.com
    ProxyPass / http://localhost:8888/
    ProxyPassReverse / http://localhost:8888/
</VirtualHost>

<VirtualHost 0.0.0.0:80>
    ServerName sub1.dev.enterprise.com
    ProxyPass / http://sub1.dev.enterprise.com:8080/
    ProxyPassReverse / http://sub1.dev.enterprise.com:8080/
</VirtualHost>

After Apache restart any request for .dev.enterprise.com/ ends up on http://localhost:8888/ Why so?

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

You have the same ServerName in both config sections.

Try running "apache2ctl -t" (debian syntax, but other distributions should have a similar command) to test your config. Apache will also tell you about such obvious mistakes in its logfile.

Btw.: Do not forget to set NameVirtualHost when using VirtualHost.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.