访问个人博客nginx
以前在网上找 CentOs 的镜像的时候,发现了阿里云的这个镜像源,速度蛮快的。今天也来搭建一个相似的站,使用 nginx 做为资源下载服务器。shell
<!--more-->vim
图片详情:服务器
安装 Nginx
设置资源存储路径
一、 资源准备阿里云
在 home 的用户目录下,创建文件夹,如 softs ,在 softs 目录中放入文件内容。spa
修改配置文件
二、 修改 Nginx 配置文件code
vim conf/nginx.conf
添加 serverserver
server { listen 80; server_name down.vcmq.com; #sendfile on; location / { alias /home/softs/; sendfile on; autoindex on; autoindex_exact_size off; autoindex_localtime on; } }
alias 设置为第一步中的资源目录,我这里是 /home/softs/教程
三、 访问测试
将本机 hosts 指向服务器, 访问地址 down.vcmq.com 显示目录列表
注意不能是/root 目录下的文件路径 ,会显示403无权限