Streaming audio files

Tag: nginx Author: kzlmapinfo Date: 2011-10-24

Our website streams audio/video files using google player.

The embed code has the right path to the file and this streaming works well when we use apache with mod wsgi.

Code snippet:

<embed class="streamembed" width="300" height="27" quality="best"
    src="http://www.google.com/reader/ui/3523697345-audio-player.swf"
    flashvars="audioUrl=http://username.webfactional.com/media/mp3/XXX.mp3" 
    type="application/x-shockwave-flash">

Everything works fine with Apache and mod wsgi and django but after the code was deployed to webfaction streaming failed.

I wonder if the streaming failed as webfaction uses nginx server to server static files How would I go about streaming mp3 files using nginx server

Other Answer1

Look at X-Accel-Redirect header for nginx.

Not sure though whether WebFaction allows you to configure a nginx private area so that files aren't publicly accessible at same time.

The general idea though is to have mp3 in file system and use X-Accel-Redirect to tell nginx front end where it is and where to serve it from.