added: config parameters:

bool log_check_proxy_ip_header;
       // check whether there is a 'log_proxy_ip_header' header
       // and if so then log the IP address from it
       // default: false

       std::wstring log_proxy_ip_header;
       // proxy header representing the real IP address of a client
       // default: X-Real-IP





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1104 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2018-05-01 10:43:20 +00:00
parent 6252a0e732
commit ba7d55b7c1
3 changed files with 19 additions and 1 deletions

View File

@ -936,8 +936,14 @@ void App::LogAccess()
log << log1; log << log1;
log.PrintDate(cur.request->start_date, config.log_time_zone_id); log.PrintDate(cur.request->start_date, config.log_time_zone_id);
log << ' ';
if( config.log_check_proxy_ip_header )
log << cur.request->headers_in.Text(config.log_proxy_ip_header, L"no-log_proxy_ip_header");
else
log << cur.request->env_remote_addr;
log << ' ' log << ' '
<< cur.request->env_remote_addr << ' '
<< cur.request->env_request_method << ' ' << cur.request->env_request_method << ' '
<< cur.request->env_http_host << cur.request->env_http_host
<< cur.request->env_request_uri << ' ' << cur.request->env_request_uri << ' '

View File

@ -149,6 +149,8 @@ void Config::AssignValues(bool stdout_is_closed)
log_env_variables = Bool(L"log_env_variables", false); log_env_variables = Bool(L"log_env_variables", false);
log_env_http_variables = Bool(L"log_env_http_variables", false); log_env_http_variables = Bool(L"log_env_http_variables", false);
log_http_answer_headers = Bool(L"log_http_answer_headers", false); log_http_answer_headers = Bool(L"log_http_answer_headers", false);
log_check_proxy_ip_header = Bool(L"log_check_proxy_ip_header", false);
log_proxy_ip_header = Text(L"log_proxy_ip_header", L"X-Real-IP");
post_file_max = Size(L"post_file_max", 8388608); // 8 MB post_file_max = Size(L"post_file_max", 8388608); // 8 MB

View File

@ -122,6 +122,16 @@ public:
// default: false // default: false
bool log_plugin_call; bool log_plugin_call;
// check whether there is a 'log_proxy_ip_header' header
// and if so then log the IP address from it
// default: false
bool log_check_proxy_ip_header;
// proxy header representing the real IP address of a client
// default: X-Real-IP
std::wstring log_proxy_ip_header;
// how many characters in values should be logged from POST parameters // how many characters in values should be logged from POST parameters
// default: 80 // default: 80
// set to 0 to turn it off // set to 0 to turn it off