vim /usr/local/nginx/conf.d/www.conf
server {
listen 80;
server_name 172.16.0.1;
root /usr/local/nginx/html;
location / {
autoindex on; #开启索引功能
autoindex_exact_size off; #显示文件大小
autoindex_localtime on; #显示文件时间
}
}
autoindex_exact_size off;
默认为on,显示出文件的确切大小,单位是bytes。
改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。
改为on后,显示的文件时间为文件的服务器时间
root@linux:/# ls /usr/local/nginx/html/
redis-6.0.8.tar.gz
/usr/local/nginx/sbin/nginx -s reload