Meow~

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1、修改配置文件/usr/local/nginx/conf/nginx.conf

指定目录,开启autoindex为on。

 location /study {
     autoindex on;
 }

2、 保存后,重启nginx服务

先检查配置文件有没有问题:

[root@aliyun conf]#/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

然后重启nginx服务:

[root@aliyun conf]#/usr/local/nginx/sbin/nginx -s reload

经过这两步,便配置成功了!

 

posted on 2018-06-05 00:35  喵弟  阅读(3812)  评论(0编辑  收藏  举报