自定义创建下载站(自动索引)!

Index为索引

真机改动hosts文件:hosts文件所在(C盘中windows、system32、drivers、etc中)

文件内容改动如下:

192.168.200.115 www.source.com

-----------------------------------------------------------------------------------------------------------

[root@localhost ~]# cd /usr/local/nginx/html/
[root@localhost html]# mkdir roomc                 //创建一个roomc的了目录

[root@localhost html]# cd roomc/

[root@localhost roomc]# mkdir {3..7}.{1..9}          //创建3.1-------7.9的文件
[root@localhost roomc]# ls
3.1   3.4    3.7    4.1    4.4    4.7    5.1    5.4    5.7     6.1    6.4     6.7    7.1    7.4     7.7
3.2   3.5    3.8    4.2    4.5    4.8    5.2    5.5    5.8     6.2    6.5     6.8    7.2    7.5     7.8
3.3   3.6    3.9    4.3    4.6    4.9    5.3    5.6    5.9     6.3    6.6     6.9    7.3    7.6     7.9

[root@localhost roomc]# cd 7.9
[root@localhost 7.9]# touch CentOS7.9.iso          //创建一个CentOs7.9.iso的镜像

[root@localhost 7.9]# cd ../../../

[root@localhost nginx]# cd conf

扫描二维码关注公众号,回复: 7290897 查看本文章

修改配置文件:

[root@localhost conf]# vim nginx.conf

创建一个location

location /roomc { autoindex on; //打开自动索引 }

点击CentOs7.9.iso也可以下载

猜你喜欢

转载自www.cnblogs.com/cxm123123form/p/11526390.html