diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-07-10 11:51:34 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-07-10 11:51:34 +0200 |
commit | ffac1727b92167ca6847b7ae3adc71f091d8048f (patch) | |
tree | 7ff9c375782d347d6ef3da3a3d02b7e39aad3c44 /hosts/surtr/http/default.nix | |
parent | 20e7a2a2544afd682f487327aa42d1899784db98 (diff) | |
download | nixos-ffac1727b92167ca6847b7ae3adc71f091d8048f.tar nixos-ffac1727b92167ca6847b7ae3adc71f091d8048f.tar.gz nixos-ffac1727b92167ca6847b7ae3adc71f091d8048f.tar.bz2 nixos-ffac1727b92167ca6847b7ae3adc71f091d8048f.tar.xz nixos-ffac1727b92167ca6847b7ae3adc71f091d8048f.zip |
...
Diffstat (limited to 'hosts/surtr/http/default.nix')
-rw-r--r-- | hosts/surtr/http/default.nix | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/hosts/surtr/http/default.nix b/hosts/surtr/http/default.nix new file mode 100644 index 00000000..a77252ff --- /dev/null +++ b/hosts/surtr/http/default.nix | |||
@@ -0,0 +1,67 @@ | |||
1 | { config, lib, pkgs, ... }: | ||
2 | { | ||
3 | imports = [ | ||
4 | ./webdav | ||
5 | ]; | ||
6 | |||
7 | config = { | ||
8 | services.nginx = { | ||
9 | enable = true; | ||
10 | # package = pkgs.nginxQuic; | ||
11 | recommendedGzipSettings = true; | ||
12 | recommendedProxySettings = true; | ||
13 | recommendedTlsSettings = true; | ||
14 | sslDhparam = config.security.dhparams.params.nginx.path; | ||
15 | commonHttpConfig = '' | ||
16 | ssl_ecdh_curve X25519:prime256v1:secp521r1:secp384r1; | ||
17 | |||
18 | log_format main | ||
19 | '$remote_addr "$remote_user" ' | ||
20 | '"$host" "$request" $status $bytes_sent ' | ||
21 | '"$http_referer" "$http_user_agent" ' | ||
22 | '$gzip_ratio'; | ||
23 | |||
24 | access_log syslog:server=unix:/dev/log main; | ||
25 | error_log syslog:server=unix:/dev/log info; | ||
26 | |||
27 | client_body_temp_path /run/nginx-client-bodies; | ||
28 | ''; | ||
29 | additionalModules = with pkgs.nginxModules; [ dav pam ]; | ||
30 | }; | ||
31 | systemd.services.nginx = { | ||
32 | preStart = lib.mkForce config.services.nginx.preStart; | ||
33 | serviceConfig = { | ||
34 | SupplementaryGroups = [ "shadow" ]; | ||
35 | ExecReload = lib.mkForce "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; | ||
36 | RuntimeDirectory = lib.mkForce [ "nginx" "nginx-client-bodies" ]; | ||
37 | RuntimeDirectoryMode = "0750"; | ||
38 | |||
39 | NoNewPrivileges = lib.mkForce false; | ||
40 | PrivateDevices = lib.mkForce false; | ||
41 | ProtectHostname = lib.mkForce false; | ||
42 | ProtectKernelTunables = lib.mkForce false; | ||
43 | ProtectKernelModules = lib.mkForce false; | ||
44 | RestrictAddressFamilies = lib.mkForce [ ]; | ||
45 | LockPersonality = lib.mkForce false; | ||
46 | MemoryDenyWriteExecute = lib.mkForce false; | ||
47 | RestrictRealtime = lib.mkForce false; | ||
48 | RestrictSUIDSGID = lib.mkForce false; | ||
49 | SystemCallArchitectures = lib.mkForce ""; | ||
50 | ProtectClock = lib.mkForce false; | ||
51 | ProtectKernelLogs = lib.mkForce false; | ||
52 | RestrictNamespaces = lib.mkForce false; | ||
53 | SystemCallFilter = lib.mkForce ""; | ||
54 | ReadWritePaths = [ "/srv/files" ]; | ||
55 | }; | ||
56 | }; | ||
57 | |||
58 | services.uwsgi = { | ||
59 | enable = true; | ||
60 | plugins = ["python3"]; | ||
61 | instance = { | ||
62 | type = "emperor"; | ||
63 | vassals = {}; | ||
64 | }; | ||
65 | }; | ||
66 | }; | ||
67 | } | ||