# HLS proxying multiple sources

**URL:** <https://www.ruby-forum.com/t/hls-proxying-multiple-sources/244272>\
**Category:** NGINX\
**Created:** [March 13, 2016, 3:41pm UTC](https://www.ruby-forum.com/t/hls-proxying-multiple-sources/244272 "2016-03-13T15:41:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [March 13, 2016, 3:41pm UTC](https://www.ruby-forum.com/t/hls-proxying-multiple-sources/244272/1 "2016-03-13T15:41:41Z")

</div>

Hello,

I need a way to provide the ‘proxy\_pass’ argument from external script  
for hls streaming. One way will be to use exec\_pull with rtmp module,  
but this means to convert hls to rtmp, and run ffmpeg - pretty  
cumbersome. If there is a way to do something like \*\* proxy\_pass  
`my_script original_request` \*\* (my\_script is in backticks), it will be  
ideal.

Situation: I need to choose dynamically the server where I pull the hls  
video stream from. Some of the upstream servers (usually 2-4 in total)  
may be down or slow at the moment where the request comes to the local  
nginx, so I need to dynamically choose the ‘preferred’ one. On top, I  
have different login credentials for those, and a limit of logins per  
server.

Almost sure nginx will have some way of doing it - it does anything  
imaginable - and few things beyond.

Any suggestion appreciated,  
Thanks, George.
