Skip to content

Instantly share code, notes, and snippets.

@ricsiga
Last active April 28, 2017 13:38
Show Gist options
  • Save ricsiga/3d91484362d8e3c796739b51081460c0 to your computer and use it in GitHub Desktop.
Save ricsiga/3d91484362d8e3c796739b51081460c0 to your computer and use it in GitHub Desktop.
letsencrypt nginx redirect
# renew letsenrcypt cert
30 2 * * 1 /usr/bin/letsencrypt renew >> /var/log/le-renew.log
35 2 * * 1 /bin/systemctl reload nginx
letsencrypt certonly --webroot -w /workspace/letsencrypt/example.com -d example.com
server {
listen 80;
server_name example.com;
root /workspace/letsencrypt/example.com;
location /.well-known {
}
location / {
rewrite ^(.*)$ https://example.com$1 permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment