Why does sub_filter seem to not work when used in conjunction with proxy_pass?
Your response probably has other content-type than defined in
sub_filter_types by default.
James T Snell answered it in a comment:
I didn't have proxy_set_header Accept-Encoding ""; you need that to tell the backend that compression isn't allowed in a response.