Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.

Commit a66651b

Browse files
author
Andy Shipman
committed
Add support for LetsEncrypt via ACME_CHALLENGE
1 parent ebbb2d1 commit a66651b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ For most Ember applications that make any kind of authenticated requests HTTPS s
6969

7070
$ heroku config:set FORCE_HTTPS=true
7171

72+
### LetsEncrypt support
73+
74+
Using `heroku config:set ACME_CHALLENGE=<challenge-phrase>` allows the app to respond correctly to the call from a manual `certbot` command that is used to generate a LetsEncrypt SSL certificate.
75+
76+
Follow these steps to get your free SSL certificate installed. (Assumes you have [SNI-SSL](https://devcenter.heroku.com/articles/ssl-beta) installed on your app.)
77+
78+
$ sudo certbot certonly --email=<your-email-address> --manual -d <your-domain-name>
79+
$ heroku config:set ACME_CHALLENGE='<challenge phrase returned from the above command>'
80+
# copy fullchain.pem privkey.pem locally from the path certbot put them
81+
$ heroku _certs:update fullchain.pem privkey.pem
82+
$ heroku config:unset ACME_CHALLENGE
83+
7284
### Prerender.io
7385

7486
[Prerender.io](https://prerender.io) allows your application to be crawled by search engines.

config/nginx.conf.erb

+7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ http {
9494
}
9595
<% end %>
9696

97+
<% if ENV["ACME_CHALLENGE"] %>
98+
location ^~ /.well-known/acme-challenge/ {
99+
return 200 '<%= ENV['ACME_CHALLENGE'] %>';
100+
add_header Content-Type text/plain;
101+
}
102+
<% end %>
103+
97104
<% if ENV["PRERENDER_HOST"] %>
98105
# Based on the official Prerender.io gist https://gist.github.com/thoop/8165802
99106
location @prerender {

0 commit comments

Comments
 (0)