infra/pastila/weechat-relay.nix
2024-06-14 22:26:05 +02:00

19 lines
No EOL
456 B
Nix

{ config, lib, pkgs, ... }:
let
mkProxy = port: {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:" + builtins.toString port + "/weechat";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 604800; # Prevent idle disconnects
'';
};
};
in
{
services.nginx.enable = true;
services.nginx.virtualHosts."relayjq.isomorphis.me" = mkProxy 9001;
}