How to initialize new subdomain with certbot

My seafile server is running in a docker container quite successfully. I have also activated the let’s encrypt certificate on https for sub domain seafile.mydomain.com
I have modified the nginx configuration so that I can forward a second sub domain to a solar logger for which I have opened port 8080 on the same gateway.
The logger device itself does not support https, but I would like to get a letsencrypt certificate for it and use proxy_pass from port 443 to 8080 on the gateway (or the local address 192.168.178.45) of the logger using nginx of the docker container.

-> How can I get the letsencrypt certificate for the additional subdomain and get the nginx.conf file modified automatically? Is it sufficient just to add the additional server with port 443 (see first block in the example below)? How does the certbot recognize that it has to add a second certificate?

# solar logger
server {
listen 443;
server_name solarlogger.mydomain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://solarlogger.mydomain.com:8080;
}
}
# Seafile:
server {
listen 443;
ssl on;
ssl_certificate /shared/ssl/seafile.mydomain.com.crt;
ssl_certificate_key /shared/ssl/seafile.mydomain.com.key;

location / {
proxy_pass http://127.0.0.1:8000/;

It depends on how you installed the Certificate. Did you use certbot with the “–nginx” Option?

If yes it should be sufficient to run

sudo certbot --nginx

again.

I did’t! The Docker container did it for me. That’s why I am asking!