I have Ant Media Server running. It typically runs on the standard RTMP port 1935. I've changed Ant to 11935 (works currently), and I want nginx to recieve 1935 and re-route it to 11935 (with a subdir).
So instead of streaming to rtmp://server.com/LiveApp/[key] you can stream to rtmp://server.com/[key]
nginx.conf
stream {
server {
listen 1935;
proxy_pass 127.0.0.1:11935;
proxy_buffer_size 32k;
}
}
sudo ufw status
1935/tcp ALLOW Anywhere
1935/tcp (v6) ALLOW Anywhere (v6)
This works currently. I can stream to rtmp://server.com/LiveApp/[key] and it's fine. But now I want to proxy rtmp://server.com/[key] -> rtmp://server.com:11935/LiveApp/[key]
My (failed) attempt at adding it as an http proxy:
server {
listen 1935;
server_name _;
location ~/(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass localhost:11935/LiveApp/$1;
}
}