On Apache you can ProxyPass everything except one or more subdirectories (with "!").
ProxyPass /subdir !
ProxyPass / http://localhost:9999/
What is the Nginx equivalent ?
My first guess is obviously not working :
location /subdir {
root /var/www/site/subdir;
}
location / {
proxy_pass http://localhost:9999/ ;
}
You can bind the proxy_pass to EXACTLY the path you like, like this
This makes sure that no other path will be passed but
/
OR
you can use this syntax for just the subdirectories to be matched
The
^~
matches the subdir and then stops searching so the/
will not be executed. It is described here.