Nginx 报错 client intended to send too large body

1:Nginx 报错日志:

2021/04/29 09:29:29 [error] 2727#2727: *81184 client intended to send too large body:

2:发现导致的原因是在 Nginx中设置的最大文件大小过小,或者没有设置导致的:

http{

     include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    
    # 配置nginx上传文件最大限制
    client_max_body_size 50m;

}
3:重启server 后:再去/var/log/nginx 下面看log, 发现: tail /var/log/nginx/error.log, 发现一条新的报错:原来的报错没有了,说明上面的修改是生效了:

2021/04/29 09:38:16 [error] 2733#2733: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:80"
2021/04/29 09:38:17 [error] 2734#2734: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 100.120.195.121, server: localhost, request: "HEAD / HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000"

4: 再尝试用firefox 连接网页:查看日志:/var/log/nginx/

[root@iZuf6gt507ja3l7ik76p6mZ nginx]# tail access.log
100.120.195.251 - - [29/Apr/2021:09:42:17 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.99 - - [29/Apr/2021:09:42:17 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.61 - - [29/Apr/2021:09:42:17 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.172 - - [29/Apr/2021:09:42:17 +0800] "GET / HTTP/1.1" 200 73968 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
100.120.195.237 - - [29/Apr/2021:09:42:17 +0800] "GET /wp-content/plugins/js_composer/assets/lib/vc_carousel/css/vc_carousel.min.css?ver=5.4.7 HTTP/1.1" 200 10296 "http://www.XXXXX.cn/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
100.120.195.146 - - [29/Apr/2021:09:42:18 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.203 - - [29/Apr/2021:09:42:19 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.183 - - [29/Apr/2021:09:42:19 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
100.120.195.124 - - [29/Apr/2021:09:42:26 +0800] "HEAD / HTTP/1.0" 301 0 "-" "-"
127.0.0.1 - - [29/Apr/2021:09:42:31 +0800] "GET / HTTP/1.1" 200 73517 "-" "Go-http-client/1.1"

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shenghuiping2001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值