Skip to content

Commit

Permalink
acme: provide full nginx example
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Oct 21, 2016
1 parent 31c72ce commit 2af7382
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions nixos/modules/security/acme.xml
Expand Up @@ -74,7 +74,27 @@ options for the <literal>security.acme</literal> module.</para>
</para>

<programlisting>
security.acme.certs."foo.example.com" = {
webroot = "/var/www/challenges";
email = "foo@example.com";
user = "nginx";
group = "nginx";
postRun = "systemctl restart nginx.service";

This comment has been minimized.

Copy link
@grahamc

grahamc Oct 21, 2016

Member

Good one. Many people don't know about this.

};
services.nginx.httpConfig = ''
server {
server_name foo.example.com;
listen [::]:80;

location /.well-known/acme-challenge {
root /var/www/challenges;
}

location / {
return 301 https://$host$request_uri;
}
}

server {
server_name foo.example.com;
listen 443 ssl;
Expand Down

0 comments on commit 2af7382

Please sign in to comment.