From ce4c2d98f168adbbc39601e77095acb103875cdb Mon Sep 17 00:00:00 2001 From: Patrick Reimers Date: Tue, 28 May 2019 19:45:37 +0200 Subject: [PATCH] Add note about extra configuration for mod_xsendfile --- components/http_foundation.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index c959f4e8a65..14d73c310a4 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -523,6 +523,26 @@ if it should:: BinaryFileResponse::trustXSendfileTypeHeader(); +.. note:: + + The ``BinaryFileResponse`` will only handle ``X-Sendfile`` if the particular header is present. + For Apache, this is not the default case. + + To add the header use the ``mod_headers`` Apache module and add the following to the Apache configuration. + + .. code-block:: apache + + + # This is already present somewhere... + XSendFile on + XSendFilePath ...some path... + + # This needs to be added: + + RequestHeader set X-Sendfile-Type X-Sendfile + + + With the ``BinaryFileResponse``, you can still set the ``Content-Type`` of the sent file, or change its ``Content-Disposition``::