Rails XSendfile via Nginx

Jonathan Matthews contact at jpluscplusm.com
Mon May 7 23:16:55 UTC 2012

On 7 May 2012 23:53, Ari King <lists at ruby-forum.com> wrote:
> Hi,
> I'm trying to configure nginx to serve a video file on behalf of my
> rails 3 backend using xsendfile. I want rails to redirect the request
> for http://myapp.com/recipes/1/video to nginx to handle. Unfortunately,
> my current configuration results in a 404 (page not found) error. I've
> pasted my nginx configuration at http://pastebin.com/VA4QFM35
> Does anyone know what could be wrong?
> Note: I have activated X-Accel-Redirect in rails by:
> # Rails configuration (e.g. config/environments/production.rb)
> config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'

Steps you could take / info you could provide:

* hit the app direct with a curl invocation and examine the headers it
creates. I bet you'll find the problem here.
* re-read the alias docs. Your location{/recipe/...} looks a bit
screwy, if the examples you've given are precise.

Jonathan Matthews
Oxford, London, UK

More information about the nginx mailing list