Comments (5)
I disagree, the original script works very well for multiple domains.
When I first read the script, I was also a bit surprised by this mkdir
statement:
domains=(example.org www.example.org)
rsa_key_size=4096
data_path="./data/certbot"
# ...
mkdir -p "$data_path/conf/live/$domains"
But this is actually fine, domains
is a Bash array, and using $domains
will give you the first element of the array.
Try this:
echo "The value of domains is: $domains"
It will print The value of domains is: example.org
, without mentioning the second domain www.example.org
. So the mkdir
command is fine.
Now as far as the actual certbot
command is concerned, the original script is IMHO much better than @masikh's version above, because it only creates one certificate, which is valid for all the given domains. The above version on the other hand creates a separate certificate for every domain.
https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options says:
-d DOMAIN, --domains DOMAIN, --domain DOMAIN
Domain names to include. For multiple domains you can
use multiple -d flags or enter a comma separated list
of domains as a parameter. All domains will be
included as Subject Alternative Names on the
certificate. The first domain will be used as the
certificate name, unless otherwise specified or if you
already have a certificate with the same name. In the
case of a name conflict, a number like -0001 will be
appended to the certificate name. (default: Ask)
from nginx-certbot.
Worked like a charm, thanks @masikh !
from nginx-certbot.
The problem seem to be that what @dietmar is saying works only for bash.
In bash I get the same result that you got executing:
echo "The value of domains is: $domains"
But when executing the same 2 commands (including the same variable assignment) in zsh I got:
The value of domains is: example.org www.example.org
from nginx-certbot.
Met the same issue today on Ubuntu 20.0.4. I defined 2 domains in array, but all commands were completed for first domain only.
I like the solution by masich more, because it's more intuitive, it's easier to read the code with explicitly defined cycles, and ofk it's more convinient to debug it.
from nginx-certbot.
Related Issues (20)
- Init script produces this error (some challenges failed) HOT 2
- Certbot failed to authenticate some domains HOT 3
- Problems creating certificates with subdomains HOT 8
- problems when setting up an application in a different docker-compose.yml HOT 1
- connection refused HOT 1
- Need Help on existing HTTP server conversion (on docker-compose) HOT 3
- Cant create private key file HOT 1
- Thank you for making this
- Nginx container stuck in a restart loop HOT 1
- Unable to connect to the app via https or browser HOT 1
- When setup renew, no nginx logs
- Turn off Matamo tracking in non-production environments
- Always challenge failed HOT 3
- Not creating a certificate for a subdomain HOT 3
- exec format errors HOT 1
- Configuration for certbot/dns-cloudflare
- Keep getting connection refused HOT 10
- - HOT 2
- Challenges fail when using envsubst template for nginx configuration. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-certbot.