Issue:
HTTP error as shown below picture
or error message found in nginx error log:
[error] 71#71: *164 client intended to send too large body: 1524386 bytes
Environment/Condition:
running workpress with docker and nginx
Resolution(s):
increase upload size by adding below syntax to nginx.conf:
client_max_body_size 8M;
Step-by-step instructions:-
1) copy original nginx.conf file from nginx container.
docker cp 98fd0d924718:/etc/nginx/nginx.conf .
Note: replace 98fd0d924718 with your nginx container id
2) open and add client_max_body_size 8M; between “http {” and before “log_format”
http { include /etc/nginx/mime.types; default_type application/octet-stream; client_max_body_size 8M; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
3) copy modified nginx.conf file back to nginx container.
docker cp nginx.conf 98fd0d924718:/etc/nginx/nginx.conf
4) enter nginx container to restart nginx service
docker exec -it 98fd0d924718 /bin/bash
service nginx reload
5) try to upload again. If you want to increase the size of upload more than default 1mb, follow this instruction (coming soon).