Skip to main content

disable mod_proxy for subdirectory (apache) [Resolved]

I have apache with one folder used for reverse proxy:


 ...
 ProxyPass /site http://server.local:8989/site
 ProxyPassReverse /site http://server.local:8989/site

How can I disable proxy for url's /site/IMAGES/* ?


Question Credit: osgx
Question Reference
Asked July 21, 2019
Posted Under: Network
25 views
3 Answers

Add before the first ProxyPass:

ProxyPass /site/IMAGES/ !

See the mod_proxy docs for the full details.


credit: fission
Answered July 21, 2019

It wouldn't have been available at the time you asked this question, but if you're using Apache HTTPD 2.4 or later, then as described in the docs you could do it with two location blocks:

<VirtualHost *:80>
  ...
  <Location /site>
    ProxyPass        http://server.local:8989/site
    ProxyPassReverse http://server.local:8989/site
  </Location>
  <Location /site/IMAGES>
    ProxyPass "!"
  </Location>
</VirtualHost>

Location blocks are interpreted in order, so you need to put the no-proxy one after the proxy one. Alternately, if you want to keep the proxy directives at the vhost level, the answer given by fission works just fine!


credit: Gagravarr
Answered July 21, 2019
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA