I need to proxy_pass static assets (.js .css) based on file extension and query strings.
domain.com/foo.css - go to upstream1 domain.com/foo.css?V=1234 - go to upstream2
Reason is I have a 3 server setup - a router, an application server and a static server. I would like any request with clean url domain.com/foo.cs to go to upstream1 (where my static server is configured). And any request that has query string url domain.com/foo.css?V=1234 to go to upstream2 (where my application server is configured).
Maybe it can be done using http://wiki.nginx.org/HttpLuaModule?