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

@@ -251,7 +251,9 @@ void Config::AssignValues(bool stdout_is_closed)
title_separator = Text(L"title_separator", L" / ");
http_header_send_file = Text(L"http_header_send_file", L"X-LIGHTTPD-send-file");
send_file_mode = Int(L"send_file_mode", 0);
send_file_header = Text(L"send_file_header", L"X-SENDFILE");
send_file_relative_prefix = Text(L"send_file_relative_prefix", L"upload-files-internal");
editors_html_safe_mode = Bool(L"editors_html_safe_mode", true);
editors_html_safe_mode_skip_root = Bool(L"editors_html_safe_mode_skip_root", true);