So, I am now able to forward/relay and incoming rtmp stream to a container. Unfortunately I had to use
iptables on the host like this:
iptables -t nat -A PREROUTING -p tcp -i enp0s3 --dport 1935 -j DNAT --to-destination 10.57.215.214 :1935
This works for one container. Well sorta. My container is getting the rtmp streams (.ts segment), but I cant play them from the internet for some reason. But that seems to be another issue that I need to work.
But anyway, the IPtables does me no good when I have multiple containers I could route to. Unless there is something with IPtables that will allow me to do this? (I doubt it)
But my bigger problem is I want to be able to route the incoming RTMP stream to a specific container based on the rtmp input. I’ve been playing around with the nginx.conf but can’t seem to figure out a working solution, if there is even one.
Any ideas how I can have the incoming rtmp stream treated like the iptables I showed, but forward the rtmp to a specific container based on the incoming rtmp stream url?