Skip to content

Instantly share code, notes, and snippets.

@FujiHaruka
Created July 7, 2017 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FujiHaruka/b7c5c3b9b3d478e15ca0c716974381a3 to your computer and use it in GitHub Desktop.
Save FujiHaruka/b7c5c3b9b3d478e15ca0c716974381a3 to your computer and use it in GitHub Desktop.
Let's Encrypt で https 対応
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install certbot

standalone

$ sudo certbot certonly --standalone -d example.com -m some@example.com --agree-tos -n

確認

$ sudo ls /etc/letsencrypt/live/
example.com

nginx.conf

server {
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

    server_name example.com;
    location / {
      ...
    }
}
@FujiHaruka
Copy link
Author

更新

sudo certbot certonly --webroot -w /var/www/html -d example.com --agree-tos --force-renewal -n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment