infra/pastila/weechat-relay.nix
2024-06-01 19:52:34 +02:00

20 lines
No EOL
540 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
proxy_set_header X-Real-IP $remote_addr; # Let WeeChat see the client's IP
'';
};
};
in
{
services.nginx.enable = true;
services.nginx.virtualHosts."relayjq.isomorphis.me" = mkProxy 9001;
}