场景:在搭建fastdfs后,配置完nginx及对应的fastdfs-nginx-module模块后,于是访问nginx,发现成功了。
但当我访问文件的路径时,报400错误。
搭建FastDFS文件服务器后,配置fastdfs-nginx-module模块时,查看nginx中logs文件夹下error文件发现
ERROR - file: /root/fastdfs-nginx-module/src//common.c, line: 709, expect parameter token or ts in url, uri: /group1/M00/00/00/wKiWtV1H4eKAKE4YAAABAE3E6HQ3627.gif
所以我的nginx配置是这样的
问题就出在ngx_fastdfs_module这个引用模块内。
通过排查发现,发现与/etc/fdfs/http.conf文件中token有关
于是我的文件是这样的
此处应该改为http.anti_steal-check_token=false或空
检查防盗链系统
vi /etc/fdfs/http.conf
http.anti_steal.check_token=false
再次重启nginx
/usr/local/nginx/sbin/nginx -s reload
刷新页面
访问成功!