I think the problem is that the proxy decodes the slashes, it rewrites %2F to / without being asked. One proxy, I donno remember if it was Apache or nginx, could get convinced to stop this url mangling by (!) appending a / to the proxy target.
See http://stackoverflow.com/questions/20496963/avoid-nginx-decoding-query-parameters-on-proxy-pass-equivalent-to-allowencodeds and https://wiki.apache.org/couchdb/Apache_As_a_Reverse_Proxy
For Apache:
AllowEncodedSlashes NoDecode