Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ruby On Rails application running on Nginx which is serving out MP3s using JW player. I need to be able to set the start time and duration for playlist items. From what I can tell to do this I need be streaming the MP3 files. How can I setup Nginx to do this?

share|improve this question

Nginx has built in support for streaming FLV files through the HttpFlvStreamModule. You nave to specify the module when you compile / recompile Nginx.

# ./configure --with-http_flv_module ...SOME-OTHER-OPTS...

You can then configure your nginx.conf to stream FLV files like so:

http {
    server {
        location ~ \.flv$ {

Now how does this help anything since the original question was about streaming MP3 files? Well you can use FFMPEG to convert the MP3s to FLV files like this:

ffmpeg -y -i /home/song.mp3 -f flv -acodec mp3 -ab 64 -ac 1 /home/song.flv
share|improve this answer
I guess that's cool if you like to use a video player to play music. I've used this before: There are quite a few other flash audio players as well. – d-_-b Feb 10 '11 at 1:48

AFAIK, Nginx is an HTTP server. To stream audio, you will need the likes of Icecast:

The technical differences between streaming and downloading are mainly with the client and server. To the end user, streaming means that they probably will not be able to save media on their machine. Download and the end user may not be able to begin watching it right away. Though in practice, most data can be viewed as soon as the first bits arrive at the client.

That being said, are you sure you need a streaming server to use JWplayer? Can't you just point it to a URL and let JW fetch it? In this case, Nginx would serve the audio just fine.

In fact, I'm pretty sure I've done this before with Apache. The video started playing after a bit of buffering - like it does with Youtube.

share|improve this answer
According to the JW player you need to be using streaming vs flat file served by a web-server in order to specify the "start" parameter. Shown in their documentation – bwizzy Feb 9 '11 at 11:43
JWplayer supports stream for video. "Support for streaming video protocols RTMP and HTTP pseudo-streaming"… I see no mention of support for streaming audio. What is you use case and why do you want to use a streaming protocol with MP3? – d-_-b Feb 10 '11 at 1:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.