Nginx 开启文件目录列表功能

使用的 LNMP 一键安装包

Nginx 虚拟主机配置文件所在目录:/usr/local/nginx/conf/vhost/

Nginx 主配置文件在:/usr/local/nginx/conf/nginx.conf

打开相应 conf 配置文件,添加

location / { 
    root /data/www/file //指定实际目录绝对路径; 
    autoindex on; //开启目录浏览功能; 
    autoindex_exact_size off; //关闭详细文件大小统计,让文件大小显示MB,GB单位,默认为b;
    autoindex_localtime on; //开启以服务器本地时区显示文件修改日期!
}

或:

Nginx 错误提示 the "ssl" directive is deprecated

Stoping nginx... nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/blog.liuguofeng.com.conf:47
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/www.liuguofeng.com.conf:46 done

配置文件中 ssl on 改成 listen 443 ssl 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注