Answer the question
In order to leave comments, you need to log in
How is it easier and more competent to connect your nginx.conf inside the container?
Good afternoon,
there is a docker image of a simple nginx based reverse proxy server that I successfully use in my docker-compose.yml.
proxy:
container_name: nginx-proxy
restart: always
image: jwilder/nginx-proxy
ports:
- 80:80
- 443:443
volumes:
- certs:/etc/nginx/certs
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock
environment:
- DEFAULT_HOST=site.ru
networks:
- main_network
Answer the question
In order to leave comments, you need to log in
The documentation says that it is enough to create a file *.conf
and put it in /etc/nginx/conf.d/
a container.
You can build your image with such a modification, for example:
FROM nginx-proxy/nginx-proxy
RUN { \
echo 'server_tokens off;'; \
echo 'client_max_body_size 500m;'; \
} > /etc/nginx/conf.d/my_proxy.conf
Add volume
Or add the whole /etc/nginx/ as a volume and remove the others
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question