Hello!<div><br></div><div>Thanks, I see. Because I do not have time for develop in C, PHP, Perl, etc everything is remain as is.</div><div><br></div><div>Bye,</div><div>Zsolt<br><div><br><div class="gmail_quote">2009/6/11 merlin corey <span dir="ltr">&lt;<a href="mailto:merlincorey@dc949.org">merlincorey@dc949.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">NginX does not provide any kind of internal API for session data or<br>
anything of that sort...  You could do what you want with embedded<br>
perl, probably, if you really want to keep it in NginX, otherwise<br>
you&#39;re back to using $cookie_name variables (which is probably the<br>
easiest/fastest solution) or you will want to write a module for NginX<br>
itself.<br>
<font color="#888888"><br>
-- Merlin<br>
</font><div><div></div><div class="h5"><br>
On Thu, Jun 11, 2009 at 3:11 AM, Artifex Maximus&lt;<a href="mailto:artifexor@gmail.com">artifexor@gmail.com</a>&gt; wrote:<br>
&gt; Hello!<br>
&gt;<br>
&gt; On Wed, Jun 10, 2009 at 11:53 PM, merlin corey &lt;<a href="mailto:merlincorey@dc949.org">merlincorey@dc949.org</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; That is precisely the kind of control required to take place in an<br>
&gt;&gt; upstream application, not nginx.  Nginx should be thought of as sort<br>
&gt;&gt; of a signal processor, that is, it sits in a stream and does its<br>
&gt;&gt; business as quickly and efficiently as possible.  Waiting on databases<br>
&gt;&gt; is neither quick nor efficient.<br>
&gt;<br>
&gt; First of all thanks for your answer Merlin!<br>
&gt; I think it as an option so user have the choice using it or not. And in this<br>
&gt; way user decides to put load on server or not. But in short there is no such<br>
&gt; option.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Also there is nothing secure about cookies, which can be completely<br>
&gt;&gt; manipulated by the client.  Session data, on the other hand, is<br>
&gt;&gt; internal and therefore much more reliable (and is basically what you<br>
&gt;&gt; want to use).<br>
&gt;<br>
&gt; I know it but not as easy as cheating on referrer. I do not look for writing<br>
&gt; the perfect protection system actually but good enough for basic protection<br>
&gt; and using as much of different techniques as possible but not more. And I do<br>
&gt; not want to write any external code (PHP in my case) let&#39;s say I am lazy. If<br>
&gt; I am able to store and retrieve used cookies and their deadline within nginx<br>
&gt; the system would be pretty useful.<br>
&gt; Is nginx have session data or some external processing required?<br>
&gt; Bye,<br>
&gt; Zsolt<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jun 10, 2009 at 3:16 AM, Artifex Maximus&lt;<a href="mailto:artifexor@gmail.com">artifexor@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hello!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Jun 9, 2009 at 2:48 PM, Artifex Maximus&lt;<a href="mailto:artifexor@gmail.com">artifexor@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; 2009/6/9 Igor Sysoev &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;:<br>
&gt;&gt; &gt;&gt;&gt; On Tue, Jun 09, 2009 at 01:30:50PM +0200, Artifex Maximus wrote:<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; I am pretty newbie to nginx and having problem on protecting my<br>
&gt;&gt; &gt;&gt;&gt;&gt; links.<br>
&gt;&gt; &gt;&gt;&gt;&gt; I am using valid_referers but is it possible using cookies for make<br>
&gt;&gt; &gt;&gt;&gt;&gt; it<br>
&gt;&gt; &gt;&gt;&gt;&gt; stronger?<br>
&gt;&gt; &gt;&gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; For example I set cookie uid with nginx&#39;s userid in &#39;location / {}&#39;<br>
&gt;&gt; &gt;&gt;&gt;&gt; and check somehow under &#39;location /download/ {}&#39; for cookie uid. Is<br>
&gt;&gt; &gt;&gt;&gt;&gt; it<br>
&gt;&gt; &gt;&gt;&gt;&gt; possible or just a dream? Userid was just an idea and not necessary.<br>
&gt;&gt; &gt;&gt;&gt;&gt; And any other ideas are welcome as well because cheating referer is<br>
&gt;&gt; &gt;&gt;&gt;&gt; easy task.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;    location /download/ {<br>
&gt;&gt; &gt;&gt;&gt;        if ($cooke_NAME = &#39;&#39;) {<br>
&gt;&gt; &gt;&gt;&gt;            return 403;<br>
&gt;&gt; &gt;&gt;&gt;        }<br>
&gt;&gt; &gt;&gt;&gt;    }<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Looks nice. Thank you Igor!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; And working perfectly though. Is there any simple solution (without<br>
&gt;&gt; &gt; PHP or any external utility) to tracking this cookies? I mean storing<br>
&gt;&gt; &gt; cookies in database and checking that cookie have sent is valid or<br>
&gt;&gt; &gt; not. Or is it too complex and not nginx task?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Bye,<br>
&gt;&gt; &gt; Zsolt</div></div></blockquote></div></div></div>