added possibility to send static files to nginx via X-Accel-Redirect header

added to config:
int send_file_mode;
    // 0 - full path to a file in send_file_header header
    // 1 - relative path to a file in send_file_header (need http_send_file_relative_prefix set) (used for nginx)
std::wstring send_file_header;
    // default: X-SENDFILE
    // for Apache set: X-SENDFILE
    // for Lighttpd set: X-LIGHTTPD-send-file
    // for Nginx set: X-Accel-Redirect
std::wstring send_file_relative_prefix;
    // relative prefix used for sending static files if send_file_mode is 1
    // default: "upload-files-internal"
This commit is contained in:
2021-09-15 20:28:34 +02:00
parent 7673264fe1
commit 55ac9a61ed
6 changed files with 90 additions and 8 deletions

View File

@@ -178,6 +178,8 @@ public:
bool CreateNewFile(Item & item);
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755, int group = -1);
bool MakeRelativeFilePath(const Item & item, const std::wstring & path_prefix, std::wstring & path, bool thumb = false);
bool MakePath(const Item & item, std::wstring & path, bool clear_path = true);
bool AddFile(Item & item, int notify_code = 0, bool call_plugins = true);