Last updated on May 11th, 2022 at 03:05 pm
Fixing upstream sent too big header while reading response header from upstream in Bitnami WordPress
The errors
I’m running Bitnami WordPress Nginx with Docker.
Recently while I submit data in a form in WordPress Amin area, the nginx server showing error with 503 and I have to check from the Docker log
2022/05/11 05:10:17 [error] 443#443: *125 upstream sent too big header while reading response header from upstream, client: 172.20.0.1, server: _, request: "POST /wp-admin/options.php HTTP/1.1", upstream: "fastcgi://unix:/opt/bitnami/php/var/run/www.sock:", host: "localhost", referrer: "http://localhost/wp-admin/admin.php?page=wp-juzhax-optimize"
The Researched
After research a while from google using the keyword Fixing upstream sent too big header while reading response header from upstream in Bitnami WordPress , most of the problem is from fastcgi_buffers and fastcgi_buffer_size
The Fixed
So we need to update the nginx.conf inside the docker container. The file path is we need to add the line is /opt/bitnami/nginx/conf/nginx.conf
List the docker
juzhax@Justins-MacBook-Air ~ % docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
aa63a037c4bb bitnami/wordpress-nginx:5 "/opt/bitnami/script…" 3 weeks ago Up 3 hours 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp wp-wordpress-1
05c7c5737ac6 bitnami/mariadb:10.6 "/opt/bitnami/script…" 3 weeks ago Up 3 hours 3306/tcp wp-mariadb-1
Copy the nginx.conf from container
juzhax@Justins-MacBook-Air ~ % docker cp aa63a037c4bb:/opt/bitnami/nginx/conf/nginx.conf ./nginx.conf
Add the line before # HTTP Server in nginx.conf
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
Send back the nginx.conf to container
juzhax@Justins-MacBook-Air ~ % docker cp ./nginx.conf aa63a037c4bb:/opt/bitnami/nginx/conf/nginx.conf
Restart the docker
Restart the docker, you are able to post more data to the server.