pastila: weechat-relay
This commit is contained in:
parent
649f63f08d
commit
c42316b4f6
3 changed files with 23 additions and 1 deletions
|
@ -13,6 +13,7 @@ in
|
||||||
./gitolite.nix
|
./gitolite.nix
|
||||||
./letsencrypt.nix
|
./letsencrypt.nix
|
||||||
./srv.nix
|
./srv.nix
|
||||||
|
./weechat-relay.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the GRUB 2 boot loader.
|
# Use the GRUB 2 boot loader.
|
||||||
|
|
|
@ -11,7 +11,8 @@ in
|
||||||
users.users."up" = {
|
users.users."up" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = up_dir;
|
home = up_dir;
|
||||||
group = config.services.nginx.group;
|
# group = config.services.nginx.group;
|
||||||
|
group = "nginx";
|
||||||
# Unsure why this is broken, but couldn't make things work without
|
# Unsure why this is broken, but couldn't make things work without
|
||||||
# creating the directory by hand.
|
# creating the directory by hand.
|
||||||
# createHome = true;
|
# createHome = true;
|
||||||
|
|
20
pastila/weechat-relay.nix
Normal file
20
pastila/weechat-relay.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ 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;
|
||||||
|
}
|
Loading…
Reference in a new issue