mirror of
https://github.com/itme-brain/nixos.git
synced 2026-05-08 14:50:12 -04:00
feat(server): restrict private services to LAN and WireGuard CIDRs
This commit is contained in:
parent
b58906f0e5
commit
2bab2759e6
5 changed files with 31 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue