In my architecture I use the /jwilder/nginx-proxy as a proxy server in my docker and then I installed 3 WordPress websites with MySQL and WordPress.
They are working well but /jwilder/nginx-proxy has a default configuration upload limit to 2MB but my WordPress template is about 20MB.
When I am trying to upload this template
413 Request Entity Too Large
nginx/1.13.6
In addition, I used below code to install /jwilder/nginx-proxy
docker run -d -p 80:80 --name nginx-proxy -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy
How can I configure the upload limits?
Regards
nginx-proxy sets up a container running nginx and docker-gen. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped. See Automated Nginx Reverse Proxy for Docker for why you might want to use this.
In order to get the reverse proxy to actually work, we need to reload the nginx service inside the container. From the host, run docker exec <container-name> nginx -t . This will run a syntax checker against your configuration files. This should output that the syntax is ok.
After searching, I create a file outside the container called client_max_body_size.conf
with the contents client_max_body_size 25m;
(or whatever) and bind mount it into your nginx-proxy container:
docker run -d --name nginx-proxy -v /var/run/docker.sock:/tmp/docker.sock \
-v $ <path>/client_max_body_size.conf:/etc/nginx/conf.d/client_max_body_size.conf:ro \
-p 80:80 jwilder/nginx-proxy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With