2025-01-09 15:38:56 +03:00
|
|
|
{ config, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.const.host.nginx;
|
|
|
|
in
|
2024-12-02 21:12:45 +03:00
|
|
|
{
|
2025-01-09 15:38:56 +03:00
|
|
|
"yt.${cfg.domain}" = {
|
|
|
|
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://[::1]:3001$request_uri";
|
|
|
|
extraConfig = cfg.allowLocal + ''
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Connection "";
|
|
|
|
proxy_hide_header Content-Security-Policy;
|
|
|
|
proxy_hide_header X-Frame-Options;
|
|
|
|
proxy_hide_header X-Content-Type-Options;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-12-02 21:12:45 +03:00
|
|
|
}
|