nginx的autoindex
如果想要把服务器上的某个目录对外开放,让所有人可以看到并下载目录里面的文件,可以使用nginx的autoindex 举个例子,我想把/home/nemo/publicdir/file/这个目录对外开放,我可以设置请求http://wwww.mysite.com/testpublic/这个url的时候,自动映射到我要开放的目录。nginx配置如下: location /testpublic/ { alias /home/nemo/publicdir/file/; autoindex on; } location / { root /home/nemo/www; try_files /notfound.html 404; } 然后重启nginx,之后在浏览器里面输入http://wwww.mysite.com/testpublic/就可以看到/home/nemo/publicdir/file/这个目录里面的文件了。 注意:…