Last active
December 10, 2015 23:22
-
-
Save kernel-sanders/0c22ab331a79e13e1b21 to your computer and use it in GitHub Desktop.
Nginx config and commands for let's encrypt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This should be in your nginx config | |
# You can put the location block in whichever server blocks need a let's encrypt cert | |
server { | |
listen 80; | |
server_name sub.domain.tld sub2.domain.tld; | |
location '/.well-known/acme-challenge' { | |
default_type "text/plain"; | |
root /tmp/letsencrypt-auto; | |
} | |
} | |
# Run these commands | |
export DIR=/tmp/letsencrypt-auto | |
export DOMAINS="-d sub.domain.tld -d sub2.domain.tld" | |
mkdir -p $DIR && ./letsencrypt-auto certonly --server https://acme-v01.api.letsencrypt.org/directory -a webroot --webroot-path=$DIR --agree-dev-preview $DOMAINS | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment