nix/host/x86_64-linux/home/nginx/Homer.nix

20 lines
460 B
Nix
Raw Normal View History

{ config, ... }:
let
cfg = config.const.host.nginx;
in
2024-12-02 21:12:45 +03:00
{
"home.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations."/" = {
tryFiles = "$uri $uri/index.html";
2025-01-09 17:08:21 +03:00
extraConfig =
cfg.allowLocal
+ ''
proxy_set_header Host "127.0.0.1";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
'';
};
};
2024-12-02 21:12:45 +03:00
}