- 问题描述
- 问题排查
- 问题原因
1、程序回调接口结果404
2、使用postman等工具直接调用正常
10.171.81.1 - - [24/Apr/2022:10:50:19 +0800] "POST /xxx/overtime HTTP/1.0" 401 7809 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36" "----"
10.171.81.1 - - [24/Apr/2022:10:52:14 +0800] "POST /xxx/overtime HTTP/1.0" 404 153 "-" "Apache-HttpClient/4.5.12 (Java/1.8.0_211)" "----"
问题排查
查看error.log,内如如下:
2022/04/24 11:15:50 [crit] 29097#29097: *2443420 open() "/var/lib/nginx/tmp/client_body/0000000419" failed (13: Permission denied), client: 10.171.81.1, server: xxxxxxx, request: "POST xxxxx HTTP/1.0", host: "xxxxx"
2022/04/24 11:15:50 [error] 29097#29097: *2443420 open() "/xxxxxx/50x.html" failed (2: No such file or directory), client: 10.171.81.1, server: xxxxx, request: "POST /xxxxxx HTTP/1.0", host: "xxxxxx"
1、首先排查了目录/var/lib/nginx/tmp/client_body
的权限是否与php-fpm nginx 用户是否一致 ps aux|grep php
2、查看nginx.conf配置,增加client_body_buffer_size
和client_max_body_size
配置。
nginx中的client_body_buffer_size
和client_max_body_size
默认较小,所以当回调参数过大时,会导致nginx
错误,导致接口返回404。这就是为什么postman请求成功(因为没传参数),而程序调用失败的原因。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)