I have a Ruby-on-Rails application that I am hosting with Apache and Phusion-Passenger (on Ubuntu Server). In this app I have a controller method that basically protects access to some files based on the currently logged in user and then servers them using X-sendfile. The method looks something like this:
def show if File.exists @file_name sendfile @file_name, :xsendfile => true else render_404 end end
It mysteriously does not work on our staging server and I suspect It has something to do with file permissions because every time I hit it I get a 404 but it is not the 404 page that my would render as a result of my
render404 call; thus I suspect the error is occurring after the
sendfile line is executed.
Could someone please clarify for me what must the file permissions be in order for apache to server something via x-sendfile.
PS I should also point out that I am quite sure that my X-sendfile module is properly configured and working so its nothing to do with that