Fastdfs和nginx整合下载时浏览器400错误

通过查看nginx的日志文件,发现报错: ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename

itcast@itcast:/usr/local/nginx/conf$ tail -20f /usr/local/nginx/logs/error.log
[2018-12-14 22:34:53] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:54] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:54] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:54] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:54] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:58] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:59] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:34:59] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:35:00] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:35:05] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:35:06] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:35:06] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:15] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:16] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:16] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:16] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:16] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:17] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:17] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid
[2018-12-14 22:36:17] ERROR - file: …/common/fdfs_global.c, line: 52, the format of filename “group1/M00/00/00/wKgheVwTuwiAKH_pAARn1TgqZeU344.png” is invalid

进入mod_fastdfs.conf ,将
url_have_group_name=false
改为
url_have_group_name=true

itcast@itcast:/etc/fdfs$ sudo vi mod_fastdfs.conf 
itcast@itcast:/etc/fdfs$ ls
client.conf         http.conf   mod_fastdfs.conf  storage.conf.sample      tracker.conf
client.conf.sample  mime.types  storage.conf      storage_ids.conf.sample  tracker.conf.sample
itcast@itcast:/etc/fdfs$ ps -ef | grep nginx
root       6598   1868  0 22:22 ?        00:00:00 nginx: master process nginx
nobody     6705   6598  0 22:33 ?        00:00:00 nginx: worker process
nobody     6706   6598  0 22:33 ?        00:00:00 nginx: worker process
itcast     6795   6553  0 22:41 pts/0    00:00:00 grep --color=auto nginx
itcast@itcast:/etc/fdfs$ sudo nginx -s stop
ngx_http_fastdfs_set pid=6798
itcast@itcast:/etc/fdfs$ sudo nginx
ngx_http_fastdfs_set pid=6801
itcast@itcast:/etc/fdfs$ ps -ef | grep nginx
root       6802   1868  0 22:41 ?        00:00:00 nginx: master process nginx
nobody     6803   6802  0 22:41 ?        00:00:00 nginx: worker process
nobody     6804   6802  0 22:41 ?        00:00:00 nginx: worker process
itcast     6806   6553  0 22:41 pts/0    00:00:00 grep --color=auto nginx

然后刷新浏览器就可以了

你可能感兴趣的:(实用工具,实用技术)