unknown directive "ngx_fastdfs_module" 问题

今天给 nginx 组合 fastdfs-nginx-module ,起初是一步一步来的。

先是在 nginx 目录下配置 fastdfs-nginx-module 的路径:

./configure --add-module=[fastdfs-nginx-module 路径]/src

然后是给 nginx 目录下的 objs/Makefile 文件中增加头文件目录:

ALL_INCS = -I src/core \
    -I /usr/include/fastdfs \  # 增加的
    -I /usr/include/fastcommon \  # 增加的
    -I src/event \
    -I src/event/modules \

接着就是在 nginx 目录下 makemake install。无报错,一切正常。

然后是拷贝 nginx/conf/mime.typesfastdfs/conf/http.conffastdfs-nginx-module/src/mod_fastdfs.conf 这三个文件到 /etc/fdfs 目录下。根据实际情况修改 mod_fastdfs.conf 文件。

最后配置 nginx.conf 如下:

location /group1/M00 {
    root /opt/YouGuan/fastDFS/storage/data;
    ngx_fastdfs_module;                                                                                                                                            
}

但是,页面仍不能直接访问图片。nginx 的错误日志中一直报:2019/05/05 22:24:53 [emerg] 67870#0: unknown directive "ngx_fastdfs_module" in /usr/local/nginx/conf/nginx.conf:70 。试了很多方法都没解决。

结果却是:没有重启 nginx 。记住,一定要重启 nginx,命令:systemctl restart nginx 。如果只是重新加载 nginx.conf 文件(nginx -s reload)是不管用的,不要问我为什么知道!

评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值