nginx-docker
Custom nginx docker + certbot && aws cli
351
This project maintains an nginx docker image to cover basic needs, such as a load balancer or distributed proxy pass for:
docker run --rm --name nginx -p 80:80 -p 443:443 \
-e DOMAIN=dominio.com \
nginx-docker
docker stack ps nginx
You can consult Nginx logs by running the following command line on any swarm cluster node:
docker logs -f --tail 100 nginx
Inside the resources/utils folder there are several files that will help you configure different features in nginx, for example:
A very simple webhook server to launch shell scripts.
In this image we include this tool to have a simple administration and control mechanism, for example to update letsencrypt certificates, enable or disable configurations
You can use the following environment variables to configure:
/etc/webhookd/users.htpasswd)Out-of-the-box, nginx doesn't support environment variables inside most configuration blocks. But this image has a function, which will extract environment variables before nginx starts.
Here is an example using docker-compose.yml:
web:
image: nginx
volumes:
- ./templates:/etc/nginx/templates
ports:
- "8080:80"
environment:
- NGINX_HOST=foobar.com
- NGINX_PORT=80
By default, this function reads template files in /etc/nginx/templates/*.template and outputs the result of executing envsubst to /etc/nginx/conf.d.
So if you place templates/default.conf.template file, which contains variable references like this:
listen ${NGINX_PORT};
outputs to /etc/nginx/conf.d/default.conf like this:
listen 80;
Directory which contains template files by default is
/etc/nginx/templates. For more info:
Content type
Image
Digest
sha256:e2906c5f5…
Size
256 Bytes
Last updated
3 months ago
docker pull robertbruno/nginx-docker:sha256-b6b952a056300abb9f0d68bbae81486f818de549d0dfef4800664f9be8c69de9.sig