在部署好FastDFS后首先进行了fdfs_test进行测试,发现数据可以正常上传,在整合nginx后进行远程访问被拒绝
对此问题,首先进行了防火墙端口的确认,在看到防火墙已经关闭后查看nginx启动的错误日志/logs/error.log,报错信息为…/common/fdfs_http_shared.c, line: 153, param “http.mime_types_filename” not exist or is empty,根据网上的教程,这种情况的解决方案主要为两种:
- 修改/etc/fdfs/mod_fastdfs.conf,增加#include http.conf
- /etc/fdfs目录中添加 http.conf和mime.type
但是上述两种问题都不存在,最后在mod_fastdfs.conf中添加
#HTTP default content type
http.default_content_type = application/octet-stream#MIME types mapping filename
#MIME types file format: MIME_type extensions
#such as: image/jpeg jpeg jpg jpe
#you can use apache’s MIME file: mime.types
http.mime_types_filename=/usr/local/etc/nginx/mime.types
重启nginx后成功