Webroot - can i point it to my unique webroot

hi all,

i have aspera servers and there webroot is in a unique location ie

/opt/aspera/shares/etc/nginx/nginx.conf

ssl_certificate /path/to/cert;
ssl_certificate_key /path/to/key;

so when i run certbot, can i do this

certbot certonly --webroot -d domain.com /opt/aspera/shares/etc/nginx/nginx.conf

will this work

thanks,
rob

A webroot is a directory in which your website is. It's usually /var/www/html and matches the root directive in nginx config.

But I think Certbot has a setting to tell it where the nginx config is. It's not --webroot though.

2 Likes

As @9peppe already said, your concept of "webroot" is incorrect. You probably mean the nginx server root directory. You can set it by using the --nginx-server-root option.

Please also see the output of:

certbot --help nginx

to get the help output for the nginx plugin.

2 Likes

And the order is incorrect; You wrote --webroot -d domain.com and then the supposed webroot path.
The correct order is:
--webroot -w "path" and then the domain(s).

So, to answer your question:

I'd say "no" (for several reasons)

1 Like

... and if you want to know why is that, that's because you can have multiple webroots in the same command, each applies to the domains that follow:

certbot --webroot -w /var/www/site1 -d site1.example.com -w /var/www/site2 -d site2.example.com

etc etc.

Do that if you want a single certificate for two sites that do not share a webroot.

2 Likes

makes sense, thank you guys

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.