From 8a86dd828913cea80d9e23fb45f5a3464a07243d Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 9 Jan 2025 13:09:49 +0300 Subject: [PATCH] Home: Share with nginx. --- host/x86_64-linux/home/Ddns.nix | 5 +---- host/x86_64-linux/home/nginx/Share.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 host/x86_64-linux/home/nginx/Share.nix diff --git a/host/x86_64-linux/home/Ddns.nix b/host/x86_64-linux/home/Ddns.nix index 4834212..95603a5 100644 --- a/host/x86_64-linux/home/Ddns.nix +++ b/host/x86_64-linux/home/Ddns.nix @@ -13,13 +13,10 @@ in [ domain ] ++ map (sub: "${sub}.${domain}") [ - "chat" - "cloud" "git" "mail" - "office" "paste" - "play" + "share" "vpn" ]; }; diff --git a/host/x86_64-linux/home/nginx/Share.nix b/host/x86_64-linux/home/nginx/Share.nix new file mode 100644 index 0000000..6018948 --- /dev/null +++ b/host/x86_64-linux/home/nginx/Share.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + "share.voronind.com".extraConfig = '' + listen 443 ssl; + + location ~* /$ { + allow 10.0.0.0/8; + allow fd09:8d46:b26::/48; + deny all; + + autoindex on; + root /storage/hot/share; + } + + location / { + autoindex off; + root /storage/hot/share; + } + + ssl_certificate /etc/letsencrypt/live/voronind.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/voronind.com/privkey.pem; + include /etc/letsencrypt/conf/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem; + ''; +}