Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


Nginx 配置之解决 413 错误(Request Entity Too Large)

Nginx 大约 399 字

错误信息

Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
使用 Nginx 服务器上传文件时,浏览器报 413 请求过大。

设置 Nginx 参数

找到配置文件nginx.conf(如没有额外配置其他conf),在http{}server{}location{}节点下添加client_max_body_size

默认client_max_body_size大小为1m

client_max_body_size 10m; #(改成你想要的数值)

重新加载

nginx -s reload

参考

http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

阅读 5358 · 发布于 2019-03-20

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批