Nginx - zhongjiajie/zhongjiajie.github.com GitHub Wiki
如果nginx服务器下面有静态文件需要访问,应该怎么配置
-
按照文件夹配置
server { location ^~ /PATH/TO/FOLDER { root /home/www/; } }
-
按照文件后缀配置
server { location ~ \.(txt|json)$ { root /home/www/; } }
增加autoindex
为on的配置
location / {
root /home/yozloy/html/;
index index.html;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
}