Skip to content

Instantly share code, notes, and snippets.

@shmdt
Last active September 14, 2018 14:02
Show Gist options
  • Save shmdt/a7940fae0df054d1b6a9c49edf7f93fb to your computer and use it in GitHub Desktop.
Save shmdt/a7940fae0df054d1b6a9c49edf7f93fb to your computer and use it in GitHub Desktop.
certbot webroot flow
mkdir path/to/frontend
mkdir path/to/backend
add to /etc/nginx/sites-enabled/frontend
server {
location ~ /.well-known {
allow all;
default_type "text/plain";
root path/to/frontend;
}
}
add to /etc/nginx/sites-enabled/backend
server {
location ~ /.well-known {
allow all;
default_type "text/plain";
root path/to/backend;
}
}
sudo nginx -t
sudo service nginx restart
sudo certbot certonly --webroot -w path/to/frontend -d example.com -w path/to/backend -d api.example.com
check if everything is ok with certbot renew use this command: sudo certbot renew --dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment