NGINX does weird things with If statements: http://wiki.nginx.org/IfIsEvil
It turns out, "if" inside a location directive w/ proxy_pass disables that implied URL-rewriting function. So, for example:
location /some/url/ {
proxy_pass http://backend/api/;
# example client url: http://server/some/url/data
# URL sent to proxy: http://backend/api/data
}