/etc/nginx/sites-available/default
location中添加autoindex_localtime on;
server {
listen 80 default_server;
root /var/www/;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
autoindex_localtime on;
}
}
sudo /etc/init.d/nginx restart