Hi Igor,<br><br>Let me make it to the point<br><br>whats the nginx equivalent for the statement in apache2?<br>RewriteRule ^/(.*) <a href="http://localhost:8080/VirtualHostBase/http/%{HTTP_HOST}:80/$1">http://localhost:8080/VirtualHostBase/http/%{HTTP_HOST}:80/$1</a> [L,P]<br>
<br><br><br><div class="gmail_quote">On Thu, Jan 22, 2009 at 11:39 AM, Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Thu, Jan 22, 2009 at 10:21:06AM +0530, Vishnu Kumar D R wrote:<br>
<br>
&gt; Igor,<br>
&gt;<br>
&gt; On Sat, Jan 17, 2009 at 1:38 PM, Igor Sysoev &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; These rewrite&#39;s are internal and invisible for client.<br>
&gt; &gt; However, it&#39;s better to use just:<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;location = / {<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proxy_pass <a href="http://localhost:6081/Kolkata" target="_blank">http://localhost:6081/Kolkata</a>;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include /usr/local/nginx/includes/proxy.conf;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Igor Sysoev<br>
&gt; &gt; <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; I am getting a error when i edited as you had said above<br>
&gt;<br>
&gt; 2009/01/21 20:38:07 [emerg] 15886#0: &quot;proxy_pass&quot; may not have URI part in<br>
&gt; location given by regular expression, or inside named location, or inside<br>
&gt; the &quot;if&quot; statement, or inside the &quot;limit_except&quot; block in<br>
&gt; /usr/local/nginx/vhosts/server03.conf:9<br>
&gt;<br>
&gt; The server03.conf exists like this<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; 7 &nbsp; &nbsp; &nbsp; &nbsp; location = / {<br>
&gt; &nbsp; &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($host ~* klk\.explocity\.com$) {<br>
&gt; &nbsp; &nbsp; &nbsp; 9 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass <a href="http://localhost:6081/Kolkata" target="_blank">http://localhost:6081/Kolkata</a>;<br>
&gt; &nbsp; &nbsp; &nbsp;10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include<br>
&gt; /usr/local/nginx/includes/proxy.conf;<br>
&gt; &nbsp; &nbsp; &nbsp;11 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; Please advice<br>
&gt; Also, i have hosted this <a href="http://klk.explocity.com" target="_blank">klk.explocity.com</a> using the rewrite(.*)<br>
&gt; If you have a look at the site, it shows the /Kolkata in all.<br>
&gt; Technically speaking, its not an ideal rewrite, right?<br>
<br>
</div></div>If you ever try to write<br>
<br>
 &nbsp; &nbsp; server {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;server_name &nbsp;<a href="http://default.explocity.com" target="_blank">default.explocity.com</a> <a href="http://klk.explocity.com" target="_blank">klk.explocity.com</a>;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location = / {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($host ~* klk\.explocity\.com$ {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp;}<br>
<br>
This means that you should use<br>
<br>
 &nbsp; &nbsp;server {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;server_name &nbsp;<a href="http://default.explocity.com" target="_blank">default.explocity.com</a>;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location = / {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp;server {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;server_name <a href="http://klk.explocity.com" target="_blank">klk.explocity.com</a>;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location = / {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp;}<br>
<br>
Do not mix server and locations.<br>
A request should be routed first by server, then by location.<br>
<font color="#888888"><br>
<br>
--<br>
</font><div><div></div><div class="Wj3C7c">Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</div></div></blockquote></div><br>