11#include <ngx_config.h>
22#include <ngx_core.h>
33#include <ngx_http.h>
4- #include <ngx_http_realip_module.h >
4+ #include <ngx_http_realip_module.c >
55#include "ngx_http_apisix_module.h"
6-
6+ #include "ngx_http_apisix_log_handler.c"
77
88#define NGX_HTTP_APISIX_SSL_ENC 1
99#define NGX_HTTP_APISIX_SSL_SIGN 2
@@ -33,7 +33,13 @@ static ngx_command_t ngx_http_apisix_cmds[] = {
3333 NGX_HTTP_LOC_CONF_OFFSET ,
3434 offsetof(ngx_http_apisix_loc_conf_t , delay_client_max_body_check ),
3535 NULL },
36-
36+ { ngx_string ("apisix_error_log_request_id" ),
37+ NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_CONF_TAKE1 ,
38+ ngx_http_apisix_error_log_request_id , //TODO: Implement this setup function
39+ NGX_HTTP_LOC_CONF_OFFSET ,
40+ offsetof(ngx_http_apisix_loc_conf_t , request_id_var_index ),
41+ NULL
42+ },
3743 ngx_null_command
3844};
3945
@@ -100,7 +106,7 @@ ngx_http_apisix_create_loc_conf(ngx_conf_t *cf)
100106 }
101107
102108 conf -> delay_client_max_body_check = NGX_CONF_UNSET ;
103-
109+ conf -> request_id_var_index = NGX_CONF_UNSET ;
104110 return conf ;
105111}
106112
@@ -111,6 +117,7 @@ ngx_http_apisix_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
111117 ngx_http_apisix_loc_conf_t * prev = parent ;
112118 ngx_http_apisix_loc_conf_t * conf = child ;
113119
120+ ngx_conf_merge_value (conf -> request_id_var_index , prev -> request_id_var_index , NGX_CONF_UNSET );
114121 ngx_conf_merge_value (conf -> delay_client_max_body_check ,
115122 prev -> delay_client_max_body_check , 0 );
116123
0 commit comments