nginx+FastDFS为什么要加软连接
server{listen 80;
root /web/www.fastdfs.com/;
location / {
root /web/www.fastdfs.com/;
index index.html index.php;
}
location /group1/M00 {
alias /data/store_fastdfs/data/;
ngx_fastdfs_module;
}
location /test {
alias /test/;
index index.html index.php;
}
}
这时候我直接访问storger浏览器返回了404错误,看了一下nginx的错误日志发现
DEBUG - file: /usr/local/src/fastdfs-nginx-module/src//common.c, line: 477, file: /data/store_fastdfs/data//M00/00/00/rAEBjU8zzXv1N9QmAANokqhR1_w299.jpg not exists, errno: 2, error info: No such file or directory
之后我在storger的数据目录里面建立了一个软连接
ln -s /data/store_fastdfs/data /data/store_fastdfs/data/M00 zhihou
再次访问就正常了。
问题:我已经在nginx里面制订了alias为什么还要添加软连接呢?
希望路过的高手给小弟解答一下,万分感谢。
同问??? 貌似是规定的
回复 2# tgnan
javascript:;
不理解是什么原理。
觉得就是让数据多存了一份吧。。 这个到时还真没找出个究竟
回复 4# tgnan
本帖最后由 wx2236y 于 2013-08-07 11:45 编辑
你使用
localtion /M00 {
root /data/fastdfs/data
ngx_fastdfs_module;
}
就不用软连了! 本帖最后由 wx2236y 于 2013-08-07 11:47 编辑
或者用
location /group1/M00/ {
alias /data/fastdfs/data/;
ngx_fastdfs_module;
} 对的,虚拟目录也行 wx2236y 发表于 2013-08-07 11:40 static/image/common/back.gif
或者用
location /group1/M00/ {
alias /data/fastdfs/data/;
加软链的作用是什么呢? 因为 nginxlocation 配置的路径啊。不然 找不到文件。
页:
[1]
2