apt-get install nginx certbot python3-certbot-nginx

For every domain create a nginx file, put it into /etc/nginx/sites-available and symlinklink it into /etc/nginx/sites/enabled: /etc/nginx/sites-available/my-domain.tld

server {      listen 80;      listen [::]:80;      server_name my-domain.tld www.my-domain.tld;       root /var/www/my-domain.tld;       index index.html index.htm;       location / {           try_files $uri $uri/ =404;      } } 

Create the corresponding dirs and index.htmls (here: /var/www/my-domain.tld)

Restart your nginx:

systemctl restart nginx

Run your certbot

certbot --nginx -d my-domain.tld -d www.my-domain.tld 

That touches your nginx domain files


This free site is ad-supported. Learn more