Hiding directory above from being shown in index

Jack asked:

I’ve added an alias to my server. When I go to it, it still shows the “../” that can redirect to the root folder. Can I hide this somehow, specifically in the alias?

server {
            autoindex on;
            root /home/myrootdirectory/;

       location / {

       location /specific {
           alias /home/myrootdirectory/specific/;


My answer:

No, and there’s no point to hiding it. One could simply edit the URL themselves. If you don’t want files published on your web server, simply do not publish them.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.