Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProxyPass but exclude certain sub directory

This is what I need to achieve I need to proxy all requests to /public/ route to another server, except that requests to /public/forms/ must not be proxied and should be served by this apache server.

I have added these directives to my httpd.conf

ProxyPass            /public/    http://localhost:3002/public/ retry=10
ProxyPassReverse     /public/    http://localhost:3002/public/

It proxies all requests to /public/ to this localhost:3002 but is there any way to exclude /public/forms/ from this proxying?

like image 776
Dmitri Avatar asked Sep 23 '16 17:09

Dmitri


1 Answers

On top of those because most specific requests should be defined first with ProxyPass add this:

ProxyPass /public/forms/ !

That tells mod_proxy to "not proxy" for that path.

like image 118
ezra-s Avatar answered Sep 20 '22 11:09

ezra-s