From 17bfbcacff1f77bf959d48ae954542d24259bb01 Mon Sep 17 00:00:00 2001 From: mc-fucker Date: Wed, 20 Jul 2022 20:09:15 +0200 Subject: [PATCH] added powerdns-web vhost --- modules/powerdns-web.nix | 37 +++++++++++++++++++++++++++++++++++ systems/mc4/configuration.nix | 1 + 2 files changed, 38 insertions(+) create mode 100644 modules/powerdns-web.nix diff --git a/modules/powerdns-web.nix b/modules/powerdns-web.nix new file mode 100644 index 0000000..8a62f76 --- /dev/null +++ b/modules/powerdns-web.nix @@ -0,0 +1,37 @@ +{ ... }: +let + domain = "powerdns.mc-fucker.cool"; + pdnsa_host = "mc5"; + pdnsa_port = "8000"; +in +{ + services.nginx.virtualHosts."${domain}" = { + forceSSL = true; + enableACME = true; + extraConfig = '' + client_max_body_size 10m; + client_body_buffer_size 128k; + proxy_redirect off; + proxy_connect_timeout 90; + proxy_send_timeout 90; + proxy_read_timeout 90; + proxy_buffers 32 4k; + proxy_buffer_size 8k; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_headers_hash_bucket_size 64; + ''; + locations = { + "/" = { + proxyPass = "http://${pdnsa_host}:${pdnsa_port}"; + extraConfig = '' + proxy_read_timeout 120; + proxy_connect_timeout 120; + proxy_redirect off; + ''; + }; + }; + }; +} +# vim: set et ts=2 sw=2 ai: diff --git a/systems/mc4/configuration.nix b/systems/mc4/configuration.nix index 8ab95b6..6703d09 100644 --- a/systems/mc4/configuration.nix +++ b/systems/mc4/configuration.nix @@ -13,6 +13,7 @@ ./modules/borg.nix ./modules/ihatemoney.nix ./modules/tandoor.nix + ./modules/powerdns-web.nix ]; programs.atop.atopacctService.enable = false;