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
|
|
|
"iot.${cfg.domain}" = {
|
|
|
|
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://[::1]:8123$request_uri";
|
|
|
|
recommendedProxySettings = false;
|
|
|
|
extraConfig = cfg.allowLocal + ''
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-12-02 21:12:45 +03:00
|
|
|
}
|