michaelklishin / nginx-x-accel-redirect-example-application
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
README | Wed Sep 17 03:42:34 -0700 2008 | |
| |
Rakefile | Wed Sep 17 02:47:18 -0700 2008 | |
| |
app/ | Wed Sep 17 03:21:26 -0700 2008 | |
| |
autotest/ | Wed Sep 17 02:47:18 -0700 2008 | |
| |
config/ | Wed Sep 17 02:47:18 -0700 2008 | |
| |
merb.thor | Wed Sep 17 02:47:18 -0700 2008 | |
| |
public/ | Wed Sep 17 02:47:18 -0700 2008 | |
| |
spec/ | Wed Sep 17 02:47:18 -0700 2008 |
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.
