acme: provide full nginx example
(cherry picked from commit 2af7382f76a6523f1220637b3ec49ad25a02b040) Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
parent
cbec6a304a
commit
d8f21b3ca3
@ -74,7 +74,27 @@ options for the <literal>security.acme</literal> module.</para>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
security.acme.certs."foo.example.com" = {
|
||||||
|
webroot = "/var/www/challenges";
|
||||||
|
email = "foo@example.com";
|
||||||
|
user = "nginx";
|
||||||
|
group = "nginx";
|
||||||
|
postRun = "systemctl restart nginx.service";
|
||||||
|
};
|
||||||
services.nginx.httpConfig = ''
|
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 {
|
||||||
server_name foo.example.com;
|
server_name foo.example.com;
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user