feat(server): restrict private services to LAN and WireGuard CIDRs

This commit is contained in:
Bryan Ramos 2026-04-12 20:37:31 -04:00
parent b58906f0e5
commit 2bab2759e6
5 changed files with 31 additions and 0 deletions

View file

@ -4,6 +4,7 @@ with lib;
let
cfg = config.modules.system.webdav;
domain = "ramos.codes";
privateAccessRules = concatMapStringsSep "\n" (cidr: "allow ${cidr};") config.modules.system.nginx.privateAllowCidrs + "\ndeny all;";
in
{
@ -50,6 +51,8 @@ in
locations."/" = {
proxyPass = "http://127.0.0.1:8090";
extraConfig = ''
${privateAccessRules}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;