Linux · 2012-02-25

Nginx无法上传文件或者time out的解决办法

nginx上传附件都失败,并且页面偶尔提示timeout或者413 Request Entity Too Large
错误日志为:

[error] 24225#0: *44 client intended to send too large body: 3005474 bytes, client: x.x.x.x, server: _, request: "POST /phpmyadmin/import.php HTTP/1.1", host: "baiqiuyi.com", referrer: "https://baiqiuyi.com/xxxxxxxxxxxxxxxxxx
打开nginx.conf并在http{}字段里添加
client_max_body_size 64M; #多少M根据实际情况填写
# keepalive_timeout 的值最好也修改一下,否则phpmyadmin上传的时候很容易time out