I got it!!!<br><br>I had misunderstood the location /media/ function.<br><br>I thought that /media/ was a virtual name for the root string.<br>I see that in fact /media/ is a directory that must exist in the root.<br><br>What confused me was that in fact, trying and trying, I had created a media folder and copied one html file into it but I forgot about that. So, I thougth that I was seeing only that html from the /static/ dir while I was seeing the copy at /static/media/.<br>
<br>Anyway this silly thing has helped me to understand nginx and its configuration a little better.<br><br>Thank you and best wishes.<br><br><br><br><div class="gmail_quote">2009/3/27 Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Fri, Mar 27, 2009 at 09:01:57AM +0000, equalium wrote:<br>
<br>
&gt; Hello, I&#39;m setting up nginx to serve a django site. The django part goes OK but<br>
&gt; I have a problem with my media directory. I&#39;m using this:<br>
&gt;<br>
&gt; location /media/ {<br>
&gt; š šroot š /home/django/domains/myapp/static/;<br>
&gt; }<br>
&gt;<br>
&gt; ...<br>
&gt;<br>
&gt; The problem is that I can access that directory and any html file directly<br>
&gt; inside but not other directories or images.<br>
<br>
</div>Probably, you have also something like this:<br>
<br>
 š šlocation ~ \.(gif|png|jpg|css|js)$ {<br>
<br>
You may delete it if it is not needed, or may disable regex tests for /media/:<br>
<br>
 š šlocation ^~ /media/ {<br>
<div class="im"><br>
&gt; For example, my directories are like this:<br>
&gt;<br>
&gt; ./domains<br>
&gt; ...myapp<br>
&gt; ......static<br>
&gt; .........CSS<br>
&gt; .........images<br>
&gt; .........js<br>
&gt; .........hello.html<br>
&gt; .........image.png<br>
&gt;<br>
&gt; I have the option &quot;autoindex on;&quot;, so when I access: <a href="http://mydomain/media/" target="_blank">http://mydomain/media/</a> I see:<br>
&gt;<br>
&gt; Index of /media/<br>
&gt; ../<br>
&gt; hello.html<br>
&gt;<br>
&gt; Does anybody know what can be wrong?<br>
<br>
</div>Do you see in the listing just index.html without image.png, etc. ?<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br>