From 9caf09a2449e4af60c2f9de9a68020e780c2bebe Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 4 Apr 2020 01:38:51 +0000 Subject: feat(ops/nixos/camden): Enable RTMP support in nginx This makes it possible to live-stream various things at rtmp://tazj.in/tvl --- ops/nixos/camden/default.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'ops/nixos') diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix index 45ce318268..a978f8873a 100644 --- a/ops/nixos/camden/default.nix +++ b/ops/nixos/camden/default.nix @@ -75,7 +75,7 @@ in lib.fix(self: { networking = { hostName = "camden"; interfaces.enp1s0.useDHCP = true; - firewall.allowedTCPPorts = [ 22 8080 80 443 ]; + firewall.allowedTCPPorts = [ 22 8080 80 443 1935 ]; }; time.timeZone = "UTC"; @@ -188,11 +188,35 @@ in lib.fix(self: { services.nginx = { enable = true; enableReload = true; + package = with nixpkgs; nginx.override { + modules = [ nginxModules.rtmp ]; + }; recommendedTlsSettings = true; recommendedGzipSettings = true; recommendedProxySettings = true; + + appendConfig = '' + rtmp_auto_push on; + rtmp { + server { + listen 1935; + chunk_size 4000; + + application tvl { + live on; + + allow publish 88.98.195.213; + allow publish 10.0.1.0/24; + deny publish all; + + allow play all; + } + } + } + ''; + commonHttpConfig = '' log_format json_combined escape=json '{' -- cgit 1.4.1