去评论
海欣资源

修改Nginx上传文件大小限制

wwwne
2022/05/07 16:26:54
我们使用ngnix做web server的时候,nginx对上传文件的大小有限制,默认是1M。
当超过大小的时候会报413(too large)错误。这个时候我们要修改nginx的参lient_max_body_size 20M;

连接超时
错误信息:504 Gateway Time-out
错误截图:


相关配置:
proxy_read_timeout:


Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.
翻译:定义从代理服务器读取响应的超时时间。超时仅在两个连续的读取操作之间设置,而不是针对整个响应的传输。如果代理服务器在此时间内没有传输任何内容,则连接将关闭。
出处:Module ngx_http_proxy_module
注意:一般的请求超时多数都是后端代码业务处理耗时较长导致,故修改这个配置较多