android文件上传413 nginx [error] 9679#0: *318855 client intended to send too large body: 1593409 bytes

来源:互联网 发布:韩顺平满汉楼数据库表 编辑:程序博客网 时间:2024/06/11 20:11

问题描述:

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: "。。。。。

解决方法:

  1. 修改/etc/php.ini 中的upload_max_filesize=20M;post_max_size = 20M
  2. nginx 配置修改:
  • 在http{}里添加参数client_max_body_size 20M;
  • keepalive_timeout  的值根据情况修改。调整超时时间。

0 0
原创粉丝点击