Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Autoindex prevent top level directory from returning to index page

$
0
0
I have a simple configuration where I want to use the autoindex feature for a particular directory. The following is the basic outline of the configuration:

server {
root /var/www;
...
location / {
index default.html
}
...
location /somedirectory {
autoindex on;
}
}

I want to prevent the parent directory handler from returning to default.html. Currently accessing:
url/somedirectory

Gives the following:
--
Index of /somedirectory/
--------------------------------
../ { clicking here returns to default.html, I want to prevent this at the top level directory }
directory1/
directory2/
directory3/


Ideally I would fix it in the web page but I have limited control to change at this point, someone stuffed the directory listings page in an iframe which means going back up one directory gives a duplicate index page inside the existing index page.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>