michaelklishin / nginx-x-accel-redirect-example-application

Nginx X-Accel-Redirect example running on Merb core.

This URL has Read+Write access

name age message
file README Wed Sep 17 03:42:34 -0700 2008 Add this... just in case. [michaelklishin]
file Rakefile Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
directory app/ Wed Sep 17 03:21:26 -0700 2008 Change signature of nginx_send_file to what Mer... [michaelklishin]
directory autotest/ Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
directory config/ Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
file merb.thor Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
directory public/ Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
directory spec/ Wed Sep 17 02:47:18 -0700 2008 Initial commit [michaelklishin]
README
This example shows how you can use X-Accel-Redirect header to make
Nginx stream files for you. Merb core has special method for it:
Merb::Controller#nginx_send_file, but it's a bit tricky to
figure out what internal redirect URI use for what file location.

See config/nginx_config_sample with a couple of comments, Files
controller for code and public/files directory content to see
how Nginx concatenates internal redirect path with root.
And don't forget to add x-accel-redirect.local to your /etc/hosts.

Hopy this saves you some time.