Proxy_pass to URL encoded path?

Hi,

I’m using proxy_pass in front of CouchDB, which has file paths which
contain some URL encoded characters (e.g.
http://couch:5984/images[b]%2F[/b]logo.gif)

I am trying to to replace some characters in requests to nginx with the
URL-encoded equivalent:

http://localhost/images/logo.gif
http://couch:5984/images[b]%2F[/b]logo.gif

My attempt was this:

rewrite  ^/images/(.*)$  /images%2F$1 break;

location ^~ /images {
       proxy_pass   http://couch:5984;
}

However, it looks like proxy_pass is double-encoding the % character,
which results in the following CouchDB request:

‘GET’ /images%252Flogo.gif

How might I do the following rewrite?:

http://localhost/images/logo.gifhttp://couch:5984/images%2Flogo.gif

Thanks

Posted at Nginx Forum:

Anyone have an idea on this?

Posted at Nginx Forum: