summaryrefslogtreecommitdiffstats
path: root/lass/2configs/services/coms/proxy.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-03-02 09:20:37 +0100
committertv <tv@krebsco.de>2023-03-02 09:20:37 +0100
commit03a9448a0922fcf158c4357922bed689245105e3 (patch)
tree7dbedf90d0443bd1e375aac61f63735f43e64984 /lass/2configs/services/coms/proxy.nix
parent177fd1eeec05f0821f1ccc63733b3e0fd5aed7b6 (diff)
parent8639d428c2e9f2190ec4e4b5dd931f24a4166f36 (diff)
Merge remote-tracking branch 'prism/master' into head
Diffstat (limited to 'lass/2configs/services/coms/proxy.nix')
-rw-r--r--lass/2configs/services/coms/proxy.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/lass/2configs/services/coms/proxy.nix b/lass/2configs/services/coms/proxy.nix
new file mode 100644
index 000000000..57e132151
--- /dev/null
+++ b/lass/2configs/services/coms/proxy.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+let
+ tcpports = [
+ 4443 # jitsi
+ 64738 # murmur
+ ];
+ udpports = [
+ 10000 # jitsi
+ 64738 # murmur
+ ];
+ target = "orange.r";
+in
+{
+ networking.firewall.allowedTCPPorts = tcpports;
+ networking.firewall.allowedUDPPorts = udpports;
+ services.nginx.streamConfig = ''
+ ${lib.concatMapStringsSep "\n" (port: ''
+ server {
+ listen ${toString port};
+ proxy_pass ${target}:${toString port};
+ }
+ '') tcpports}
+ ${lib.concatMapStringsSep "\n" (port: ''
+ server {
+ listen ${toString port} udp;
+ proxy_pass ${target}:${toString port};
+ }
+ '') udpports}
+ '';
+
+ services.nginx.virtualHosts."jitsi.lassul.us" = {
+ enableACME = true;
+ acmeFallbackHost = "${target}";
+ addSSL = true;
+ locations."/" = {
+ recommendedProxySettings = true;
+ proxyWebsockets = true;
+ proxyPass = "http://${target}";
+ };
+ };
+}