默认情况下使用nginx反向代理上传超过2MB的文件,会报错413 Request Entity Too Large,解决这个方法很简单,修改配置client_max_body_size值即可
修改nginx.conf
#cat /usr/local/nginx-1.7.0/conf/nginx.conf | grep client_max_body_size client_max_body_size 10M;
如果需要上传更大的文件,那么client_max_body_size改成更大的值即可,这边改成了10MB文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-413-request-entity-too-large/
重启nginx
# /usr/local/nginx-1.7.0/sbin/nginx -s reload文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-413-request-entity-too-large/文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-413-request-entity-too-large/
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
3F
memory_limit 不需要设置吧?
2F
mark
1F
还需要修改php上传文件大小限制
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 32M
;The maximum size of an uploaded file.
upload_max_filesize = 20M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 10M
B1
@ 默北 谢谢补充