If you’re getting this error message “upstream sent too big header while reading response header from upstream” in the nginx error log and are using fcgi, in my case I was running a PHP script via PHP FPM 8.2 and received a 502 response from nginx. I fixed the issue.
Read Article