<br><div class="gmail_quote"><span dir="ltr"></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi<div class="im"><br><br>location = /x/y {<br>

        # ... process it right here<br>
    }<br></div>What should i need to write here.Sorry i am not familiar with nginx directives ..<br>Thanks<div><div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Sat, Jul 9, 2011 at 6:53 PM, Maxim Dounin <span dir="ltr">&lt;<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hello!<br>
<div><br>
On Sat, Jul 09, 2011 at 06:19:04PM +0530, milin korath wrote:<br>
<br>
&gt; Hello<br>
&gt;<br>
&gt; I am running my djago application in nginx server. In my configuration I<br>
&gt; redirect all http to https using the below  settings<br>
&gt;<br>
&gt; location / { rewrite ^/(.*) <a href="https://mydomain.com/$1" target="_blank">https://mydomain.com/$1</a> permanent; }<br>
&gt;<br>
&gt; What i want is i need to redirect to all my http request to https  except<br>
&gt; only one url like <a href="http://mydomain.com/x/y" target="_blank">http://mydomain.com/x/y</a>.<br>
&gt;<br>
&gt; I tried<br>
&gt;<br>
&gt; location ~* / {<br>
<br>
</div>There is no need to use regexp here, just normal &quot;location /&quot; will<br>
do the same thing.<br>
<div><br>
&gt;     rewrite ^/(.*) <a href="https://mydomain.com/$1" target="_blank">https://mydomain.com/$1</a> permanent;<br>
<br>
</div>Something like<br>
<br>
    rewrite ^ <a href="https://mydomain.com" target="_blank">https://mydomain.com</a>$request_uri? permanent;<br>
<br>
is a bit more effecient way to do the same thing.<br>
<div><br>
&gt; }<br>
&gt;<br>
&gt; location = <a href="http://mydomain.com/x/y" target="_blank">mydomain.com/x/y</a> {<br>
<br>
</div>You don&#39;t need &quot;<a href="http://mydomain.com" target="_blank">mydomain.com</a>&quot; here, just &quot;location = /x/y&quot;.<br>
<div><br>
&gt;     rewrite ^/(.*) <a href="http://mydomain.com/$1" target="_blank">http://mydomain.com/$1</a> permanent;<br>
<br>
</div>And you don&#39;t need redirect here, as it will create infinite loop<br>
as long as this is config for http part of <a href="http://mydomain.com" target="_blank">mydomain.com</a>.<br>
<div><br>
&gt; }<br>
&gt;<br>
&gt; But no luck.Can you please advice me what went wrong here.Really i am struck<br>
&gt; with this.<br>
<br>
</div>Bringing all of the above together gives something like this:<br>
<br>
    location / {<br>
        rewrite ^ <a href="https://mydomain.com" target="_blank">https://mydomain.com</a>$request_uri? permanent;<br>
    }<br>
<br>
    location = /x/y {<br>
        # ... process it right here<br>
    }<br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>