Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Kong | 34,431 | 2 hours ago | 249 | apache-2.0 | Lua | |||||
🦍 The Cloud-Native API Gateway | ||||||||||
Awesome Compose | 22,256 | 6 days ago | 7 | April 23, 2021 | 99 | cc0-1.0 | HTML | |||
Awesome Docker Compose samples | ||||||||||
Nginx Proxy | 16,928 | a day ago | 449 | mit | Python | |||||
Automated nginx proxy for Docker containers using docker-gen | ||||||||||
Authelia | 15,949 | 1 | 7 hours ago | 34 | September 19, 2022 | 109 | apache-2.0 | Go | ||
The Single Sign-On Multi-Factor portal for web apps | ||||||||||
Apisix | 11,561 | 9 hours ago | 666 | apache-2.0 | Lua | |||||
The Cloud-Native API Gateway | ||||||||||
Caprover | 10,171 | 15 hours ago | 99 | other | TypeScript | |||||
Scalable PaaS (automated Docker+nginx) - aka Heroku on Steroids | ||||||||||
Heimdall | 5,678 | 19 days ago | 23 | mit | PHP | |||||
An Application dashboard and launcher | ||||||||||
Nginx Ui | 4,195 | 7 months ago | 25 | mit | Python | |||||
Nginx UI allows you to access and modify the nginx configurations files without cli. | ||||||||||
Kubernetes Ingress | 4,163 | 1 | 3 hours ago | 101 | April 07, 2022 | 56 | apache-2.0 | Go | ||
NGINX and NGINX Plus Ingress Controllers for Kubernetes | ||||||||||
Devilbox | 4,080 | 15 days ago | 42 | mit | PHP | |||||
A modern Docker LAMP stack and MEAN stack for local development |
Simple nginx image (alpine based) with integrated Let's Encrypt support.
get docker-compose.yml and change things:
TZ=UTC
. For more timezone values check /usr/share/zoneinfo
directoryLETSENCRYPT=true
if you want an automatic certificate install and renewalLE_EMAIL
should be your email and LE_FQDN
for domainLE_FQDN=aaa.example.com,bbb.example.com
LETSENCRYPT
to false
and pass your own cert in SSL_CERT
, key in SSL_KEY
and SSL_CHAIN_CERT
etc/service-example.conf
to make your own etc/service.conf
. Keep ssl directives as is:
ssl_certificate SSL_CERT;
ssl_certificate_key SSL_KEY;
ssl_trusted_certificate SSL_CHAIN_CERT;
make sure volumes
in docker-compose.yml changed to your service config
you can map multiple custom config files to in compose using service*.conf
filename pattern,
see service2.conf
in docker-compose.yml
file for reference
Alternatively, mount directory with *.conf
files into /etc/nginx/conf.d-le
directory inside
the container to have them all copied at once.
stream*.conf
files are picked up into /etc/nginx/stream.d/
directory and included into stream
section of the Nginx configuration, see stream2.conf
in docker-compose.yml
file for reference.
Alternatively, mount directory with *.conf
files into /etc/nginx/conf.d-le
directory inside
the container to have them all copied at once.
pull image - docker-compose pull
if you don't want a pre-built image, make you own. docker-compose build
will do it
start it docker-compose up
On start of the container all following text matches in custom configuration files you mounted will be replaced,
variable with dollar sign ($
, like $LE_FQDN
) will be taken from environment, please see next table for their list.
Matching pattern | Value | nginx usage | Description |
---|---|---|---|
SSL_CERT | /etc/nginx/ssl/$SSL_CERT |
ssl_certificate |
Public SSL certificate, sent to client |
SSL_KEY | /etc/nginx/ssl/$SSL_KEY |
ssl_certificate_key |
SSL private key, not sent to client |
SSL_CHAIN_CERT | /etc/nginx/ssl/$SSL_CHAIN_CERT |
ssl_trusted_certificate |
Trusted SSL certificates, not sent to client |
LE_FQDN | $LE_FQDN |
server_name |
List of domains, useful for configuration with single server block |
Variable | Default value | Description |
---|---|---|
SSL_CERT | le-key.pem |
certbot privkey.pem new filename |
SSL_KEY | le-crt.pem |
certbot fullchain.pem new filename |
SSL_CHAIN_CERT | le-chain-crt.pem |
certbot chain.pem new filename |
LETSENCRYPT | false |
Enables Let's Encrypt certificate retrieval and renewal |
LE_FQDN | comma-separated list of domains for Let's Encrypt certificate, required if LETSENCRYPT is true
|
|
LE_EMAIL | comma-separated list of emails for Let's Encrypt certificate, required if LETSENCRYPT is true
|
|
TZ | Timezone, if set will be written to container's /etc/timezone
|
Important: provided nginx.conf handles
http->https redirect automatically, no need to add it into your custom service.conf
. In case if you need a custom server on
http (:80) port, make sure you handle /.well-known/
path needed with root
set for LE challenge: location /.well-known/ {root /usr/share/nginx/html;}
certbot
package.script/entrypoint.sh
requests LE certificate and will refresh every 10 days in case if certificate is close to expiration (30day)script/le.sh
gets SSLnginx-le
container.*.example.com
, DNS challenge)In your docker-compose.yml
disable automatic Let's Encrypt certificate creation/renewal.
environment:
- LETSENCRYPT=true
# after starting nginx-le connect to it
docker exec -it nginx sh
# change `*.example.com` to your domain name
certbot certonly \
--manual \
--manual-public-ip-logging-ok \
--preferred-challenges=dns \
--email "${LE_EMAIL}" \
--agree-tos \
-d "*.example.com"
# it will ask you to create/update TXT DNS record
# depending on your DNS provider it can take some time
# you can check if DNS is already updated using dig utility
dig txt _acme-challenge.example.com
# copy certificates for nginx-le to use them
cp -fv /etc/letsencrypt/live/example.com/privkey.pem /etc/nginx/ssl/le-key.pem
cp -fv /etc/letsencrypt/live/example.com/fullchain.pem /etc/nginx/ssl/le-crt.pem
cp -fv /etc/letsencrypt/live/example.com/chain.pem /etc/nginx/ssl/le-chain-crt.pem
# use the same procedure for renewal