I'm not a big fan of it either.  This nginx config is something I've been wanting to cleanup for a while.  Perhaps something like `^(/test)?/bower_components/(.*)$` would work instead, although I don't remember if there was anything else I was trying to capture when I wrote that.