Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VirtualHost set to proxy all requests to another server running on port 9000.

What I have :

ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/

What I've tried :

! ProxyPass /test.html http://localhost:9000/
ProxyPass /test.html ! http://localhost:9000/
ProxyPassMatch !^/(.*\.html)$ http://localhost:9000/$1 

None of which worked...

I'd like to exclude a file or a set of files from being proxied, the documentation says something about "The ! directive is useful in situations where you don't want to reverse-proxy a subdirectory.", but there are no examples for that situation.

share|improve this question
up vote 10 down vote accepted

Ok, figured it out, turns out that - obviously - there's no need to specify the proxy for excluded paths.

ProxyPass /somedir !

works great

share|improve this answer
    
Hmm. This is interesting because if you were using AJP to link to Tomcat (for serving dynamic JSP content) , then this directive might allow you to , for example, exclude the "/images" directory on the server so that Tomcat serves the images instead of Tomcat??? – djangofan Apr 28 '11 at 22:43
    
Well, it does. I'm not sure I understand your question. – Andrei May 3 '11 at 17:10
    
Note that this has to go before the other ProxyPass directives in order to have an effect, since the first match is the one that gets applied. – Ryan Thompson Jan 18 at 1:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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