Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

add nginx support for :x_sendfile option in file streaming

#2718

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/

Reported by Rick · May 25th, 2009 @ 09:06 PM

State: resolved
Milestone: 3.0.2
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: Low

Activity

  1. Michael Koziarski
  2. Pratik
    Pratik
    • Assigned user changed from Rick to Yehuda Katz (wycats)
    • State changed from new to incomplete

    Patch please.

    August 12th, 2009 @ 02:22 AM

  3. Vladimir Meremyanin
    Vladimir Meremyanin

    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.

    August 27th, 2009 @ 02:38 PM

  4. Rizwan Reza
    Rizwan Reza
    • 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.

    January 24th, 2010 @ 09:16 AM

  5. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • 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.

    February 23rd, 2010 @ 09:49 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM

  7. bingbing
    bingbing
    • Tag changed from nginx, server to server, nginx

    March 26th, 2011 @ 02:07 AM