From adcff66454ee9851f11ade40710894d1d05bb563 Mon Sep 17 00:00:00 2001 From: spacewander Date: Sun, 16 Jul 2017 14:12:46 +0800 Subject: [PATCH] feature: applied a patch to the nginx core to make the nginx variable $proxy_add_x_forwarded_for accessible on Lua land. Signed-off-by: Yichun Zhang (agentzh) --- patches/nginx-1.11.2-proxy_host_port_vars.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/patches/nginx-1.11.2-proxy_host_port_vars.patch b/patches/nginx-1.11.2-proxy_host_port_vars.patch index 93bb9d6..0f3353a 100644 --- a/patches/nginx-1.11.2-proxy_host_port_vars.patch +++ b/patches/nginx-1.11.2-proxy_host_port_vars.patch @@ -1,6 +1,6 @@ ---- nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c 2013-10-08 05:07:14.000000000 -0700 -+++ nginx-1.11.2-patched/src/http/modules/ngx_http_proxy_module.c 2013-10-27 15:29:41.619378592 -0700 -@@ -602,10 +602,10 @@ static ngx_keyval_t ngx_http_proxy_cach +--- nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 ++++ nginx-1.11.2-patched/src/http/modules/ngx_http_proxy_module.c 2017-07-16 14:02:51.000000000 +0800 +@@ -793,13 +793,13 @@ static ngx_keyval_t ngx_http_proxy_cach static ngx_http_variable_t ngx_http_proxy_vars[] = { { ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0, @@ -12,4 +12,8 @@ + NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 }, { ngx_string("proxy_add_x_forwarded_for"), NULL, - ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 }, +- ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 }, ++ ngx_http_proxy_add_x_forwarded_for_variable, 0, 0, 0 }, + + #if 0 + { ngx_string("proxy_add_via"), NULL, NULL, 0, NGX_HTTP_VAR_NOHASH, 0 },