Welcome! Log In Create A New Profile

Advanced

Nginx/Unit sendfile failed for upstream

June 23, 2019 03:09AM
Hello

I have nginx (1.15.9) + unit(1.9) + php(7.2.15).

When uploading files larger then 8Mb Nginx was failing with 413 Payload too large, so in nginx.conf, http {} section I added "client_max_body_size=0" - it worked for nginx, but now Unit is rejecting uploads.

Everything works fine for uploads smaller then ~8MB. When I go above that value, browser will fail with 502 Bad Gateway, Unit will log nothing and nginx/error.log will have a following line:

2019/06/23 08:38:14 [error] 20682#20682: *3 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 127.0.0.1, server: wp1.wrf, request: "POST /uploader.php HTTP/1.1", upstream: "http://127.0.0.1:8301/uploader.php", host: "wp1.wrf", referrer: "http://wp1.wrf/zamowienie,dodaj-zdjecia.html"

PHP limits: post_max_size=40M, upload_max_filesize=20M verified with phpinfo - but uploader.php is never executed in that case (it logs every request in separate file, no log files are created (not even empty)).

In Unit docs (http://unit.nginx.org/configuration/#settings) there is something called "max_body_size", however it is impossilbe to adjust that value. I've made PUT / POST requests to /config/max_body_size, /config/settings/http/max_body_size and many other variations, all without success, e.g.:

curl -X PUT -d '"30M"' --unix-socket /var/run/control.unit.sock http://localhost/config/max_body_size
{
"error": "Invalid configuration.",
"detail": "Unknown parameter \"max_body_size\"."
}

Any help would be appreciated.
Cheers,
Bartek
Subject Author Posted

Nginx/Unit sendfile failed for upstream

Bartek June 23, 2019 03:09AM

Re: Nginx/Unit sendfile failed for upstream

Sergey A. Osokin June 23, 2019 09:14AM

Re: Nginx/Unit sendfile failed for upstream

Bartek June 24, 2019 09:48AM

Re: Nginx/Unit sendfile failed for upstream

Sergey A. Osokin June 24, 2019 07:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 291
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready