2

I'm using this library, and it works as expected. I just want to add an attribute client_max_body_size 50M to Nginx, but where to add it in the docker-compose file:

nginx-proxy:
  image: jwilder/nginx-proxy
  container_name: nginx-proxy
  ports:
  - '80:80'
  - '443:443'
  volumes:
  - /var/run/docker.sock:/tmp/docker.sock:ro
  - nginx-certs:/etc/nginx/certs:ro
  - nginx-vhost:/etc/nginx/vhost.d
  - nginx-html:/usr/share/nginx/html
  labels:
  - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true
  restart: always

letsencrypt-nginx-proxy-companion:
  image: jrcs/letsencrypt-nginx-proxy-companion
  container_name: nginx-letsencrypt
  volumes:
  - /var/run/docker.sock:/var/run/docker.sock:ro
  - nginx-certs:/etc/nginx/certs
  - nginx-vhost:/etc/nginx/vhost.d
  - nginx-html:/usr/share/nginx/html
  restart: always
  depends_on:
  - "nginx-proxy"
lucahuy
  • 790
  • 2
  • 9
  • 22

1 Answers1

1

You need to create a docker file with that configuration and add build config in the docker-compose file.

First, create a Dockerfile named nginx_proxy.df with the following content.

FROM jwilder/nginx-proxy
RUN echo "client_max_body_size 50m;" >> /etc/nginx/conf.d/custom_proxy_settings.conf

Then add it to the same location of docker-composer file.

Update your docker-compose file like this.

nginx-proxy:
    build:
            context: ./
            dockerfile: nginx_proxy.df
    container_name: nginx-proxy
    .............
minhazur
  • 4,928
  • 3
  • 25
  • 27