美文网首页
解决 nginx 出现 413 Request Entity T

解决 nginx 出现 413 Request Entity T

作者: lookphp | 来源:发表于2018-05-04 11:02 被阅读11次

1.若nginx用所用的 php 请求解析服务是 fpm, 则检查 /etc/php5/fpm/php.ini 文件中的参数

upload_max_filesize = 20M  
post_max_size = 20M  

重启fpm服务

service php5-fpm restart  

然后上传20M以内的文件,若仍出现 413 错误,则排除 php.ini 的问题

2.在 /etc/nginx/sites-enabled/xxxx 网站配置中加入下面字段

server {  
    ...  
    client_max_body_size 20m;  
    ...  
}  

重启nginx服务

service nginx restart  

问题解决!

相关文章

网友评论

      本文标题:解决 nginx 出现 413 Request Entity T

      本文链接:https://www.haomeiwen.com/subject/flqdrftx.html