caddy: added crowfx.web.id domain

This commit is contained in:
Tigor Hutasuhut 2024-09-16 08:34:40 +07:00
parent f7dbe0e3fc
commit 4cd08447ae

View file

@ -15,15 +15,7 @@ in
} }
''; '';
services.caddy.virtualHosts."router.tigor.web.id".extraConfig = '' services.caddy.virtualHosts =
@denied not remote_ip private_ranges
respond @denied "Access denied" 403
reverse_proxy 192.168.100.1
'';
services.caddy.virtualHosts."tigor.web.id".extraConfig =
let let
domains = attrsets.mapAttrsToList (name: _: strings.removePrefix "https://" name) config.services.caddy.virtualHosts; domains = attrsets.mapAttrsToList (name: _: strings.removePrefix "https://" name) config.services.caddy.virtualHosts;
sortedDomains = lists.sort (a: b: a < b) domains; sortedDomains = lists.sort (a: b: a < b) domains;
@ -53,11 +45,29 @@ in
</body> </body>
</html>''; </html>'';
in in
'' {
header Content-Type text/html "router.tigor.web.id".extraConfig = ''
respond <<EOF @denied not remote_ip private_ranges
${html}
EOF 200 respond @denied "Access denied" 403
'';
reverse_proxy 192.168.100.1
'';
"tigor.web.id".extraConfig =
''
header Content-Type text/html
respond <<EOF
${html}
EOF 200
'';
"crowfx.web.id".extraConfig =
''
header Content-Type text/html
respond <<EOF
${html}
EOF 200
'';
};
}; };
} }