Forum: NGINX mp3 pass through?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ilan B. (Guest)
on 2009-03-03 23:59
(Received via mailing list)
Hi All,

Currently we are doing a lot of MP3 transfers on our webserver
and this month we exceeded our bandwidth, which is fine, but can be

We have a separate DB server that I'm thinking of off loading the MP3
traffic to, so essentially I'd like to do the following:

1. Install Nginx on DB server
2. Add rule to re-route all mp3 requests to the db server

(1) I can handle (2) I'm not sure about.  If anyone could clue me in on
to write the configuration rule for routing the .mp3 files that would be

Thanks all!!!
Nick P. (Guest)
on 2009-03-04 03:22
(Received via mailing list)
rewrite  ^/media/(.*\.mp3)$$1  last;

If updating the code that makes these request (i.e., the website or
.swf) is
an option, then it might be better to go ahead and direct these MP3
to your secondary server.  Also might be worth looking into a content
delivery network (CDN), or a basic asset host (Amazon S3 offers both).

You can find more rewrite examples here:
This topic is locked and can not be replied to.