为什么余庆的 nginx_fastdfs_module 的 INSTALL 中第五步用 root 不是 alias ?
这是项目的地址
#step 5. config the nginx config file such as nginx.conf, add the following lines:
location /M00 {
root /home/yuqing/fastdfs/data;
ngx_fastdfs_module;
}
#step 6. make a symbol link ${fastdfs_base_path}/data/M00 to ${fastdfs_base_path}/data,command line such as:
ln -s /home/yuqing/fastdfs/data /home/yuqing/fastdfs/data/M00
接触nginx不久,但是 /M00 作为一个不存在的目录,不选择 alias 来让 /home/yuqing/fastdfs/data 将其替换,不是会访问错误吗?——(因为在第六步中添加了软连接,使得/home/yuqing/fastdfs/data/M00,实际上是/home/yuqing/fastdfs/data)
但是在黑马C++项目之分布式服务器编程_哔哩哔哩_bilibili中也是使用root,但是并没有创建软连接,然后成功下载文件了。请问这是为什么呢?
后面我个人测试的时候将root和alias都没加上去(如下),但是还是能成功下载到文件。访问的URL为:
location /group1/M00/ {
# 告诉服务器资源的地址,root被注释掉了
# root /home/li/fastDFS/storage/data;
ngx_fastdfs_module;
}
还有ngx_fastdfs_module指令起到了什么作用呢?我觉得很可能是ngx_fastdfs_module的作用。