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/ ;
}