This repository has no description
1.1 kB
39 lines
1{
2 networking.firewall.allowedTCPPorts = [
3 80
4 443
5 ];
6 security.acme.acceptTerms = true;
7 security.acme.defaults.email = "acme@lassul.us";
8
9 services.nginx = {
10 enable = true;
11 recommendedGzipSettings = true;
12 recommendedOptimisation = true;
13 recommendedTlsSettings = true;
14
15 enableReload = true;
16
17 # avoid nixpkgs nginx's /tmp/nginx_* compile-time defaults: under
18 # systemd PrivateTmp they don't survive a host `rm -rf /tmp/*`.
19 appendHttpConfig = ''
20 client_body_temp_path /var/cache/nginx/client_body;
21 proxy_temp_path /var/cache/nginx/proxy;
22 fastcgi_temp_path /var/cache/nginx/fastcgi;
23 uwsgi_temp_path /var/cache/nginx/uwsgi;
24 scgi_temp_path /var/cache/nginx/scgi;
25 '';
26
27 virtualHosts.default = {
28 default = true;
29 locations."/".extraConfig = ''
30 return 404;
31 '';
32 locations."= /etc/os-release".extraConfig = ''
33 default_type text/plain;
34 alias /etc/os-release;
35 '';
36 locations."~ ^/.well-known/acme-challenge/".root = "/var/lib/acme/acme-challenge";
37 };
38 };
39}