Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running Apache 2.2 on FreeBSD. As of late I've been looking at Cherokee + uWSGI for some Django/Python.

I want to keep Apache 2.2 at the front (port 80 replies) and proxy connections to my Cherokee server running at the same machine.

My problem is that I've got some legacy stuff for a few dir locations on my URL.

I want / to go to my Cherokee (reverse proxy) but keep Apache for /dir1/ and /dir2/.

I got the reverse proxy working fine with mod_proxy.

ProxyRequests            Off
<Location />
    ProxyPass                http://127.0.0.1:8080/
    ProxyPassReverse         http://127.0.0.1:8080/
</Location>

Cherokee is running at port 8080 on localhost.

The problem is that I can't figure out how to turn off the reverse proxy for /dir1/ and /dir2/ so that Apache process the incoming requests to the dirs.

Is it possible to add Location directives for /dir1/ and /dir2/ to tell Apache not to reverse proxy the dirs?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

From reading ProxyPass's doc, You should do something like that :

ProxyPass                /dir1/ !
ProxyPass                /dir2/ !
ProxyPass                /      http://127.0.0.1:8080/
ProxyPassReverse         /      http://127.0.0.1:8080/
share|improve this answer
    
Thank you very much, exactly what I was looking for. The final solution was to move the ProxyPass + ProxyPassReverse outside <Location> and move /dir1/ and /dir2/ ! before the ProxyPass in order to catch it before the / ProxyPass –  Daniel Johansson Feb 15 '10 at 16:38
    
I've edited the answer to reflect that. –  mat Feb 15 '10 at 16:39
    
This is extremely useful as LocationMatch directives will not work with ProxyPass correctly. –  Lucas Holt Apr 18 '13 at 17:50
add comment

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.