Regarding ERROR: XmlParseFailure

Pankaj Kaushik dev.panky2014 at gmail.com
Sun Aug 10 04:42:32 UTC 2014


Hey Francis,



> Your request is for "/". The only location block you have is a prefix
> match for the four-character string "$uri", which does not match
> your request, so the request is processed by the default server-level
> configuration.
>
>
I have understanding that $uri will be changed to actual uri when location
block will be parsed.

why is it not happening?

There are two scenario in my case.

My uri can contain two values one is "/" and other is let say "/abc/def"
(this value is dynamic and can change according to the client request).

So i want to redirect above uri values to different upstream server.

How can i do this?

I tried below configuration but it did not worked for uri location block.

upstream backend {
                hash $key2 consistent; // this will be used for given
bucket name based on consistent hash policy
                server 10.0.0.22:8080;
                server 10.0.0.23:8080;
                server 10.0.0.24:8080;
                server 10.0.0.25:8080;
                server 10.0.0.26:8080;
        }
        upstream backend_2 {
                server 10.0.0.22:8080;
                server 10.0.0.23:8080;
                server 10.0.0.24:8080;
                server 10.0.0.25:8080;
                server 10.0.0.26:8080;
        }

            server {
                listen 90 default_server;

                location $uri {
                    proxy_pass http://backend;
                }
                location / {
                    proxy_pass http://backend_2;
                }
        }

Can you please suggest me right step on this?

Thanks,
Panky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140810/d20fd6f4/attachment.html>


More information about the nginx mailing list