15

I have the following in my httpd.conf

<VirtualHost *:80>
    ServerName foo.org
    ServerAlias www.foo.org

    <Proxy *>
        Options FollowSymLinks MultiViews
        Order allow,deny
        Allow from all
        AllowOverride All
    </Proxy>

    ProxyPass        / http://127.0.0.1:5012/
    ProxyPassReverse / http://127.0.0.1:5012/
</VirtualHost>

This works well as all requests for http://foo.org get served from port 5012 using a different web server. However, I want to serve just http://foo.org/lib via Apache from port 80. How do I do that? Adding the following lines to the conf doesn't help

Alias /lib /path/to/lib

<Directory "/path/to/lib">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
punkish
  • 303
  • 2
  • 4
  • 9

1 Answers1

28

You can avoid proxying for a specific location by telling mod_proxy to ignore it with a ! for a destination:

ProxyPass        /lib !
ProxyPass        / http://127.0.0.1:5012/
ProxyPassReverse / http://127.0.0.1:5012/
Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • awesome! it was that easy! I tried `NoProxy` and `ProxyMatch with various regexps` to no avail. Thanks. – punkish Feb 26 '12 at 00:21