Skip to content

Instantly share code, notes, and snippets.

@giordanocardillo
Last active November 23, 2016 11:16
Show Gist options
  • Save giordanocardillo/53a00277c753d854aa4e9ed1717eb6c1 to your computer and use it in GitHub Desktop.
Save giordanocardillo/53a00277c753d854aa4e9ed1717eb6c1 to your computer and use it in GitHub Desktop.
nginx + proxy + Let's encrypt configuration

Let's Encrypt authentication virtual host

If you need to use a docker machine or any other server listening on other port than 80, you can use this snippet to authenticate your domain with Let's encrypt.

  1. Add the content of site.conf to your nginx configuration
  2. Create the folder /var/www/letsencrypt
  3. Run the certbot-auto using the webroot plugin --webroot -w /var/www/letsencrypt/
#Let's encrypt configuration -START-
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
location = /.well-known/acme-challenge/ {
return 404;
}
#Let's encrypt configuration -END-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment