Welcome! Log In Create A New Profile

Advanced

[PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Yichun Zhang (agentzh)
October 27, 2013 06:48PM
Hello!

Recently a user of our ngx_lua module reported that he could not
access $proxy_host and $proxy_port in Lua because these two variables
set the flag NGX_HTTP_VAR_NOHASH:

https://github.com/chaoslawful/lua-nginx-module/issues/301

The patch below removes this flag from these two variables to make
them accessible in dynamic languages like Perl and Lua. Comments
welcome!

Thanks!
-agentzh

--- nginx-1.4.3/src/http/modules/ngx_http_proxy_module.c 2013-10-08
05:07:14.000000000 -0700
+++ nginx-1.4.3-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
static ngx_http_variable_t ngx_http_proxy_vars[] = {

{ ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH,
0 },
+ NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },

{ ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH,
0 },
+ 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 },
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Yichun Zhang (agentzh) 966 October 27, 2013 06:48PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Maxim Dounin 355 October 28, 2013 04:42PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Yichun Zhang (agentzh) 361 October 28, 2013 05:46PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Maxim Dounin 438 October 30, 2013 10:18AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready