I want to let people publish on one url, for example:
rtmp://domain:1935/app/stream_name
In this url the stream_name could be a username or whatsoever. The stream_name is dynamic. Now I want to load balance this as following. I have a load balancer which works like:
```
stream {
upstream publish_rtmp_backend {
hash stream_name; <----------------------- Can't find a variable with the stream_name in it for the hash
server publish-rtmp:1935; <---------- hostname to dnsrr from docker service publish-rtmp
}
server {
listen 19350;
proxy_pass publish_rtmp_backend;
}
}
```
My docker-compose.yml for nginx-rtmp container looks like:
```
...
publish-rtmp:
image: publish-rtmp
deploy:
mode: replicated
replicas: 5
endpoint_mode: dnsrr
...
```
So I have 5 containers running with nginx-rtmp. Why can't I get the uri of the rtmp://domain:1935/app/stream_name url in the upstream block of the tcp load balancer. If this isn't possible what is a best practice of handling this.
rtmp://domain:1935/app/stream_name
In this url the stream_name could be a username or whatsoever. The stream_name is dynamic. Now I want to load balance this as following. I have a load balancer which works like:
```
stream {
upstream publish_rtmp_backend {
hash stream_name; <----------------------- Can't find a variable with the stream_name in it for the hash
server publish-rtmp:1935; <---------- hostname to dnsrr from docker service publish-rtmp
}
server {
listen 19350;
proxy_pass publish_rtmp_backend;
}
}
```
My docker-compose.yml for nginx-rtmp container looks like:
```
...
publish-rtmp:
image: publish-rtmp
deploy:
mode: replicated
replicas: 5
endpoint_mode: dnsrr
...
```
So I have 5 containers running with nginx-rtmp. Why can't I get the uri of the rtmp://domain:1935/app/stream_name url in the upstream block of the tcp load balancer. If this isn't possible what is a best practice of handling this.