This project is archived and is in readonly mode.
add nginx support for :x_sendfile option in file streaming
Reported by Rick | May 25th, 2009 @ 09:06 PM | in 3.0.2
Only Apache is supported right now. We should make it more web server agnostic.
Proposed:
- Turn the X_SENDFILE_HEADER constant into a method that can be set (keeping the const around for 2.x compatibility).
- Add config option like: config.action_controller.streaming_header = :apache | :nginx | :lighttpd
- Support SERVER_SOFTWARE env var for autodetection. Passenger just added support for this.
ENV['SERVER_SOFTWARE'] && ENV['SERVER_SOFTWARE'] =~ /nginx/
Comments and changes to this ticket
-
Michael Koziarski June 9th, 2009 @ 08:37 AM
- Milestone cleared.
-
Pratik August 12th, 2009 @ 02:22 AM
- Assigned user changed from Rick to Yehuda Katz (wycats)
- State changed from new to incomplete
Patch please.
-
Vladimir Meremyanin August 27th, 2009 @ 02:38 PM
I think it is better not to "Add config option like: config.action_controller.streaming_header = :apache | :nginx | :lighttpd" but use "config.action_controller.streaming_engine = XAccelRedirect.new | XSendFile.new | PlainStream.new | ..." because XAccelRedirect takes relative url, while XSendFile uses filesystem path. Maybe some other nuances present.
I can code it if no one is working on it at the moment.
-
Rizwan Reza January 24th, 2010 @ 09:16 AM
- Tag set to nginx, server
Vladmir, it doesn't seem anyone else is working on this at the moment. Can you work on a patch for this?
Thanks.
-
Yehuda Katz (wycats) February 23rd, 2010 @ 09:49 PM
- State changed from incomplete to resolved
This is a dup of other sendfile related issues. The correct solution is to use the fact that Rack can take a File, and people can use the SendFile middleware in Rack (or we can use it by default) to optimize that case.
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
-
bingbing March 26th, 2011 @ 02:07 AM
- Tag changed from nginx, server to server, nginx
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>