<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 style> </span>listen 80;</p>
<p class="MsoNormal"><span style> </span><span style> </span><span style> </span>server_name <a href="http://geotest.com">geotest.com</a>;</p>
<p class="MsoNormal"><span style> </span><span style> </span><span style> </span>proxy_buffering on;</p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style> </span>proxy_redirect<span style> </span>off;</p>
<p class="MsoNormal"><span style> </span><span style> </span>proxy_set_header<span style> </span>Host<span style> </span>$host;</p>
<p class="MsoNormal"><span style> </span><span style> </span>proxy_set_header<span style> </span>X-Real-IP<span style> </span>$remote_addr;</p>
<p class="MsoNormal"><span style> </span><span style> </span><span style> </span>proxy_set_header<span style> </span>X-Forwarded-For<span style> </span>$proxy_add_x_forwarded_for;</p>
<p class="MsoNormal" style="text-indent:36.0pt">location / {</p>
<p class="MsoNormal"><span style> </span><span style> </span>proxy_pass<span style> </span><a href="http://192.168.0.1/">http://192.168.0.1/</a>;<span style> </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 style> </span><span style> </span>proxy_pass<span style> </span><a href="http://192.168.0.2/">http://192.168.0.2/</a>;<span style> </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 class="MsoListParagraph" style><span style><span style>1.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com">geotest.com</a> <span style="font-family:Wingdings"><span style>à</span></span>
Working fine getting the contents of app1 server</p>
<p class="MsoListParagraph" style><span style><span style>2.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/a1">geotest.com/a1</a> <span style="font-family:Wingdings"><span style>à</span></span>
Working fine getting the contents of app1 server</p>
<p class="MsoListParagraph" style><span style><span style>3.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/cms">geotest.com/cms</a> <span style="font-family:Wingdings"><span style>à</span></span>
Not working. Site proxypass to app2 server but we are getting a 404 page.</p>
<p class="MsoListParagraph" style><span style><span style>4.<span style="font:7.0pt "Times New Roman"">
</span></span></span><a href="http://geotest.com/cmsssss">geotest.com/cmsssss</a> <span style="font-family:Wingdings"><span style>à</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">http://www.frlinux.eu/?p=199</a> in which
we use the server name as <a href="http://geotest.com">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 class="im"><br>
> We have 3 servers with Nginx as webserver. The setup is as follows:<br>
<br>
</div><div class="im">> 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 class="im"><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 class="HOEnZb"><font color="#888888"><br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><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>
</font></span></blockquote></div><br>