Welcome! Log In Create A New Profile

Advanced

proxy_pass to URL encoded path?

May 07, 2010 08:06PM
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:

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

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


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

'GET' /images[b]%252F[/b]logo.gif


How might I do the following rewrite?:

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


Thanks
Subject Author Posted

proxy_pass to URL encoded path?

7zark7 May 07, 2010 08:06PM

Re: proxy_pass to URL encoded path?

7zark7 June 14, 2010 06:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready