How can I configure mod_proxy to ProxyPass everything except X VirtualHosts?

117

Solution 1

The first vhost in the file (or that is included) is the default, and is where it will fall through to. Thus, just make the first vhost be the proxy, then a second that is www.acme.com.

Solution 2

If you don't have a VirtualHost definition match (based on ServerName/ServerAlias), Apache will serve your request with the first VirtualHost. (See the docs).

Set up a virtual host with a name like 000-first, and put your ProxyPass configuration in that. They are included in directory sort order.

Share:
117

Related videos on Youtube

simpleguy
Author by

simpleguy

Updated on September 17, 2022

Comments

  • simpleguy
    simpleguy almost 2 years

    The question is while restarting the windows service whether windows kills the service or it waits for the process to finish. As i remember in linux the "restart" command will kill all the child process.

    Thanks in advance. I searched the question in this forum but didn't find.

    • Cody Gray
      Cody Gray over 12 years
      Yes, it waits. What problem are you trying to solve?
    • Chad von Nau
      Chad von Nau over 12 years
      This kind of question really belongs on serverfault.com or superuser.com. They are sister sites to Stack Overflow and are about general computer nerdery, whereas SO is specifically about programming. Sorry to be "that guy".
  • Bill Weiss
    Bill Weiss over 14 years
    Just beat me :(
  • Rafal T
    Rafal T over 14 years
    So I renamed the "jetty" file to "default" tossing the original one that comes with apache. I then made a www.test.com file, published it via a2ensite, and confirmed that sites-enabled contained "000-default" and "www.test.com". I then modified my host file (on Windows) with an entry mapping www.test.com to my server. Unfortunately it's still rendering through the proxy/Jetty.
  • Bill Weiss
    Bill Weiss over 14 years
    Run apache2ctl -S and see what the output is. Make sure it sees two vhosts, and that the right one is marked as "default".