问题描述:
android 图片文件上传服务器返回 413
ios 上传正常
排查:
# whereis nginx
# vi /etc/nginx/nginx.conf
查看日志存放地址
# cat /var/log/nginx/hiad.error.log
nginx [error] 9679#0: *318855 client intended to send too large body: 1593409 bytes
2015/01/28 10:36:07 [error] 9679#0: *318855 client intended to send too large body: 1593409 bytes, client: 119.6.106.214, server: adtest.ihimi.net, request: "POST /wxkmsvc/dataService?app=mobile&controller=upload&action=upload HTTP/1.1", host: "。。。。。
解决方法:
- 修改/etc/php.ini 中的upload_max_filesize=20M;post_max_size = 20M
- nginx 配置修改:
- 在http{}里添加参数client_max_body_size 20M;
- keepalive_timeout 的值根据情况修改。调整超时时间。