S
S
Salavat Sharapov2014-06-19 10:31:14
Nginx
Salavat Sharapov, 2014-06-19 10:31:14

Is it possible to close a location in nginx?

The Nginx(static+media)+Apache+Django bundle works.
In Nginx configs:

location /media/ {
        alias /home/user/site.com/media/;
        expires 30d;
        #deny all;
        break;
 } 
Далее прокси на Apache.

This all works, BUT I would not like the /media directory tree to be shown in the browser when going to site.com/media/
Is this possible? Or since Nginx gives all the "media", the directory will definitely be displayed on port 80 under the link site .com/media/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EminH, 2014-06-19
@desperadik

and index.html tried to throw?

L
lev, 2014-06-25
@lev

In general, this is solved by the directive

autoindex off;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question