Hi,<div><br></div><div>Im not expert but i think you must specify /cms BEFORE / because "/" will match everything</div><div><br></div><div>best regards</div><div><br></div><div>andreas</div><div><br></div><div><br>

</div><div><div>Threepwood: Ha-ha! Taste cold steel, feeble cannon restraint rope! </div>
<br><br><div class="gmail_quote">2013/3/19 Geo P.C. <span dir="ltr"><<a href="mailto:pcgeopc@gmail.com" target="_blank">pcgeopc@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<p class="MsoNormal">Thanks for your reply. Please see this:<br></p><p class="MsoNormal"><br></p><p class="MsoNormal">In Proxy server we have the setup as follows:</p>

<p class="MsoNormal"></p>

<p class="MsoNormal">server {</p>

<p class="MsoNormal"><span> </span>listen 80;</p>

<p class="MsoNormal"><span></span><span> </span><span></span>server_name <a href="http://geotest.com" target="_blank">geotest.com</a>;</p>

<p class="MsoNormal"><span></span><span> </span><span></span>proxy_buffering on;</p>

<p class="MsoNormal" style="text-indent:36.0pt"><span></span>proxy_redirect<span> </span>off;</p>

<p class="MsoNormal"><span></span><span> </span>proxy_set_header<span> </span>Host<span> </span>$host;</p>

<p class="MsoNormal"><span> </span><span> </span>proxy_set_header<span> </span>X-Real-IP<span> </span>$remote_addr;</p>

<p class="MsoNormal"><span> </span><span> </span><span></span>proxy_set_header<span> </span>X-Forwarded-For<span> </span>$proxy_add_x_forwarded_for;</p>

<p class="MsoNormal" style="text-indent:36.0pt">location / {</p>

<p class="MsoNormal"><span></span><span> </span>proxy_pass<span> </span><a href="http://192.168.0.1/" target="_blank">http://192.168.0.1/</a>;<span> </span>#app1 server</p>

<p class="MsoNormal" style="margin-left:36.0pt;text-indent:36.0pt">}</p>

<p class="MsoNormal" style="text-indent:36.0pt">location /cms {</p>

<p class="MsoNormal"><span> </span><span> </span>proxy_pass<span> </span><a href="http://192.168.0.2/" target="_blank">http://192.168.0.2/</a>;<span> </span># app2 server</p>



<p class="MsoNormal" style="margin-left:36.0pt;text-indent:36.0pt">}</p>

<p class="MsoNormal" style="text-indent:36.0pt">}</p>

<p class="MsoNormal">Now while accessing the url the result are as follows:</p>

<p class="MsoNormal"></p>

<p><span><span>1.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com" target="_blank">geotest.com</a> <span style="font-family:Wingdings"><span></span></span>
Working fine getting the contents of app1 server</p>

<p><span><span>2.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/a1" target="_blank">geotest.com/a1</a> <span style="font-family:Wingdings"><span></span></span>
Working fine getting the contents of app1 server</p>

<p><span><span>3.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/cms" target="_blank">geotest.com/cms</a> <span style="font-family:Wingdings"><span></span></span>
Not working. Site proxypass to app2 server but we are getting a 404 page.</p>

<p><span><span>4.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/cmsssss" target="_blank">geotest.com/cmsssss</a> <span style="font-family:Wingdings"><span></span></span>Same as above result.</p>

<p class="MsoNormal"></p>

<p class="MsoNormal">For your information the cms application running app2 server
is graphite server and you can find the nginx configuration file from the url: <a href="http://www.frlinux.eu/?p=199" target="_blank">http://www.frlinux.eu/?p=199</a> in which
we use the server name as <a href="http://geotest.com" target="_blank">geotest.com</a></p>

<p class="MsoNormal"></p>

<p class="MsoNormal">So can you please help us on it.</p>

<p class="MsoNormal"></p>

<p class="MsoNormal">Thanks</p>

<p class="MsoNormal">Geo<br></p>

<p class="MsoNormal"></p><br><div class="gmail_quote">On Tue, Mar 19, 2013 at 2:50 PM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



On Tue, Mar 19, 2013 at 09:25:09AM +0530, Geo P.C. wrote:<br>
<br>
Hi there,<br>
<div><br>
> We have 3 servers with Nginx as webserver. The setup is as follows:<br>
<br>
</div><div>> So in proxy server we need to setup as while accessing <a href="http://geotest.com" target="_blank">geotest.com</a> and all<br>
> its subdirectories like <a href="http://geotest.com/*" target="_blank">geotest.com/*</a> it should go to app server 1 except<br>
> while accessing <a href="http://geotest.com/cms" target="_blank">geotest.com/cms</a> and its subdirectories it should go to app<br>
> server2.<br>
><br>
> Please let us know how we can configure it.<br>
<br>
</div>"location /cms" should have "proxy_pass" to app2, "location /" should have<br>
"proxy_pass" to app1. Almost exactly as you show. Except that you spell<br>
"cms" "ui", for some reason.<br>
<div><br>
> In proxy server we setup as follows but is not working:<br>
<br>
</div>Be specific.<br>
<br>
What one request do you make that does not give the response that you<br>
expect? What response do you get instead?<br>
<br>
Other things: you must set the world up so that the browser actually<br>
gets to your proxy server when requesting <a href="http://geotest.com" target="_blank">geotest.com</a>. That's outside<br>
of anything nginx can do.<br>
<br>
You must set things up so that nginx actually gets to your app2 server<br>
when...<br>
<br>
>                 proxy_pass <a href="http://app2.com" target="_blank">http://app2.com</a>;<br>
<br>
...using the name <a href="http://app2.com" target="_blank">app2.com</a>. That needs a working resolver, or a configured<br>
upstream block. Or just use the IP address directly here.<br>
<br>
And you will *probably* want to make sure that everything on app2 knows<br>
that it is effectively being served below /cms, as otherwise any links<br>
to other resources on that server may not work as you want.<br>
<br>
(And note that "location /cms" and "location /cms/" do different things,<br>
and may not both be what you want.)<br>
<span><font color="#888888"><br>
    f<span class="HOEnZb"><font color="#888888"><br>
--<br>
Francis Daly    <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></font></span></blockquote></div><br>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>