mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-18 15:34:13 +01:00
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
41 lines
1.3 KiB
Nix
41 lines
1.3 KiB
Nix
{myvars, ...}: {
|
|
services.caddy = {
|
|
enable = true;
|
|
# Reload Caddy instead of restarting it when configuration file changes.
|
|
enableReload = true;
|
|
user = "caddy"; # User account under which caddy runs.
|
|
dataDir = "/var/lib/caddy";
|
|
logDir = "/var/log/caddy";
|
|
|
|
# Additional lines of configuration appended to the global config section of the Caddyfile.
|
|
# Refer to https://caddyserver.com/docs/caddyfile/options#global-options for details on supported values.
|
|
globalConfig = ''
|
|
http_port 80
|
|
https_port 443
|
|
auto_https off
|
|
'';
|
|
|
|
# ACME related settings.
|
|
# email = myvars.useremail;
|
|
# acmeCA = "https://acme-v02.api.letsencrypt.org/directory";
|
|
|
|
virtualHosts."http://grafana.writefor.fun".extraConfig = ''
|
|
encode zstd gzip
|
|
reverse_proxy http://localhost:3000
|
|
'';
|
|
virtualHosts."http://prometheus.writefor.fun".extraConfig = ''
|
|
encode zstd gzip
|
|
reverse_proxy http://localhost:9090
|
|
'';
|
|
virtualHosts."http://alertmanager.writefor.fun".extraConfig = ''
|
|
encode zstd gzip
|
|
reverse_proxy http://localhost:9093
|
|
'';
|
|
virtualHosts."http://attic.writefor.fun".extraConfig = ''
|
|
encode zstd gzip
|
|
reverse_proxy http://localhost:8888
|
|
'';
|
|
};
|
|
networking.firewall.allowedTCPPorts = [80 443];
|
|
}
|