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"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></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>
> Igor,<br>
><br>
> On Sat, Jan 17, 2009 at 1:38 PM, Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> wrote:<br>
><br>
> ><br>
> > These rewrite's are internal and invisible for client.<br>
> > However, it's better to use just:<br>
> ><br>
> > location = / {<br>
> > proxy_pass <a href="http://localhost:6081/Kolkata" target="_blank">http://localhost:6081/Kolkata</a>;<br>
> > include /usr/local/nginx/includes/proxy.conf;<br>
> > }<br>
> ><br>
> ><br>
> > --<br>
> > Igor Sysoev<br>
> > <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
> ><br>
> ><br>
> I am getting a error when i edited as you had said above<br>
><br>
> 2009/01/21 20:38:07 [emerg] 15886#0: "proxy_pass" may not have URI part in<br>
> location given by regular expression, or inside named location, or inside<br>
> the "if" statement, or inside the "limit_except" block in<br>
> /usr/local/nginx/vhosts/server03.conf:9<br>
><br>
> The server03.conf exists like this<br>
><br>
> 7 location = / {<br>
> 8 if ($host ~* klk\.explocity\.com$) {<br>
> 9 proxy_pass <a href="http://localhost:6081/Kolkata" target="_blank">http://localhost:6081/Kolkata</a>;<br>
> 10 include<br>
> /usr/local/nginx/includes/proxy.conf;<br>
> 11 }<br>
><br>
> Please advice<br>
> Also, i have hosted this <a href="http://klk.explocity.com" target="_blank">klk.explocity.com</a> using the rewrite(.*)<br>
> If you have a look at the site, it shows the /Kolkata in all.<br>
> Technically speaking, its not an ideal rewrite, right?<br>
<br>
</div></div>If you ever try to write<br>
<br>
server {<br>
server_name <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>
location = / {<br>
if ($host ~* klk\.explocity\.com$ {<br>
...<br>
}<br>
}<br>
}<br>
<br>
This means that you should use<br>
<br>
server {<br>
server_name <a href="http://default.explocity.com" target="_blank">default.explocity.com</a>;<br>
<br>
location = / {<br>
...<br>
}<br>
<br>
}<br>
<br>
server {<br>
server_name <a href="http://klk.explocity.com" target="_blank">klk.explocity.com</a>;<br>
<br>
location = / {<br>
...<br>
}<br>
}<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>