Forum: NGINX How to tell Nginx not to decode URL for proxy_pass?

E1becab774e65697b147cc50aa996553?d=identicon&s=25 Ville Mattila (Guest)
on 2013-10-11 03:24
(Received via mailing list)

I need to pass a certain URI namespace to an upstream servers, while
away the prefix. Consider following configuration:

    location ^~ /going-to-upstream/ {
        access_log off;
        rewrite /upstream(/.*) $1 break;
        proxy_pass http://upstream;

    location / {
        # Actual server

So, whenever I will get a request to
http://server/going-to-upstream/something -> I should have a request in
upstream server for "/something". And I do.

However, as soon as the upstream part has something urlencoded, for
an url, nginx decodes the url and passes it in decoded format to the
upstream. An example:

will cause an upstream request "/something/http://server/" while I would
need literally "/something/http%3A%2F%2Fserver%2F"

How could I make the nginx to not decode the URI in rewrite?

(My actual use case is related to using Thumbor, see
They have a dedicated nginx server { } for this, but I need to use an
existing to make Thumbor urls to live under our main application

Best regards,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.