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

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-03-06
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-01-04
  • 2022-12-23
相关资源
相似解决方案