Reverse proxy quietly capped my upload size and i spent a day blaming the encoder

spent most of yesterday convinced my encoder was mangling anything over a certain size. uploads of the big source files kept dying at the same point, smaller ones went through clean, so obviously it was the encode step right. nope. the nginx sitting in front was on the default client_max_body_size and silently 413ing the big ones before they ever reached the backend. nothing in my app logs because the request never got that far. bumped the limit, everything just worked. a whole day gone. anyone else got a good one where the thing you spent hours blaming wasnt the thing at all

thats the classic one, the failure happens a layer below anything you control so you sit staring at the wrong logs for hours. when an upload dies right at a size boundary now, the first thing i check is the proxy limit and the fpm limits, because the app genuinely cannot tell you about a request it never received. then i make the proxy log that 413 somewhere i actually read, otherwise next time is just as silent.

default is 1m on nginx, which catches everyone exactly once. raise it, but raise post_max_size and upload_max_filesize on the fpm side to match or you just move the wall back one layer and smack into it again with a slightly bigger file.

i have almost the same yesterday but on the php side not the proxy. my upload stop at some size and i am sure my code is broken, i read it three time. was post_max_size too small. two place to change and i change only one. now i keep both numbers written in a note so i stop forgetting which file wants which.

the real crime is how quiet a 413 is out of the box, it dies at the edge so it never lands where youre looking. i turn on logging for those on every client box now just so the next person doesnt burn a day on it. honestly half the upload tickets i get are this, and the other half are a timeout on a slow connection, which looks identical from the users side until you check which one actually fired.

did exactly this dance the first time, felt like whack a mole, fix nginx hit fpm, fix fpm hit a timeout. ended up putting the proxy and fpm limits in the same config template so they cant drift apart on me again. small thing but i stopped getting ambushed by it. still a little annoyed a full day vanished over one line in a conf file though.