My domains are:
ptif.co.uk, www.ptif.co.uk, ptifscreen.co.uk, www.ptifscreen.co.uk
I ran this command:
certbot certonly \
--test-cert \
--break-my-certs \
--expand \
--webroot \
--webroot-path /tmp/acme-challenge-screen \
-d ptifscreen.co.uk \
-d www.ptifscreen.co.uk \
--webroot-path /tmp/acme-challenge \
-d ptif.co.uk \
-d www.ptif.co.uk \
--agree-tos \
--email john@fernholt.myzen.co.uk \
--verbose \
--rsa-key-size 4096 \
--keep-until-expiring \
--preferred-challenges=http
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for ptifscreen.co.uk and 3 more domains
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/ptifscreen.co.uk/fullchain.pem
Key is saved at: /etc/letsencrypt/live/ptifscreen.co.uk/privkey.pem
This certificate expires on 2023-10-01.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
My web server is (include version):
I am using the Nginx Docker image: nginx:latest
Nginx is in a Docker Container, Certbot is Not in a Container. Certbot is installed on the host.
The operating system my web server runs on is (include version):
Debian GNU/Linux 11 (bullseye)
My hosting provider, if applicable, is:
Linode
I can login to a root shell on my machine (yes or no, or I don't know):
I can login as root.
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
Not using control panel
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot):
I am using certbot 2.6.0
My Problem
I am running the certbot command and hoping to get four certificates but I am only getting one (ptifscreen.co.uk).
I am running Nginx is a Docker Container. Certbot is installed on the host.
Running the certbot command works and doesn't error, but only one certificate is created.
The nginx conf file to create the certificates is:
server {
listen 80;
listen [::]:80;
server_name ptifscreen.co.uk www.ptifscreen.co.uk;
location /.well-known/acme-challenge/ {
root /tmp/acme-challenge-screen;
}
location / {
root /usr/share/nginx/html;
index index.html;
}
}
server {
listen 80;
listen [::]:80;
server_name ptif.co.uk www.ptif.co.uk;
location /.well-known/acme-challenge/ {
root /tmp/acme-challenge;
}
location / {
root /usr/share/nginxptif/html;
index index.html;
}
}
To create the Certificate only, I use this Docker compose file. I use a different one to serve the targets as a reverse proxy after the certificate has been installed.:
version: '3.7'
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
volumes:
- ./config/nginx_init:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt:ro
- /tmp/acme-challenge:/tmp/acme-challenge
- /var/log/nginx:/var/log/nginx
- ./config/tmpsite:/usr/share/nginx/html
- ./config/tmpsiteptif:/usr/share/nginxptif/html