修改 nginx.conf 文件,添加配置和 server:
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
server {
listen 8080;
location / {
root /usr/local/appkg/;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
上面的三个配置中:
autoindex on,显示目录
autoindex_exact_size on,显示文件大小
autoindex_localtime on,显示文件时间
测试配置是否正常:
nginx -t
重启 Nginx:
nginx -s reload
访问:
http://116.65.17.130:8080/
会显示文件列表:
Index of /
../
docker-centos7.tar 28-Nov-2019 15:31 1586932736
作者 Github : tojohnonly , 博客 : EnskDeCode
5435

被折叠的 条评论
为什么被折叠?



