Re: header handling

2015-08-17 Thread Frank Liu
Hi Maxim, Thanks for you comment! Do you have any other approaches/suggestions? I use nginx as a proxy/load-balancer. The request will be processed by the upstream java servers. I assume my change won't actually modify the actual header, so upstream will still get the original header and can disti

Re: header handling

2015-08-17 Thread Maxim Dounin
Hello! On Sat, Aug 15, 2015 at 12:15:47AM -0700, Frank Liu wrote: > I made the below patch and can now use $upstream_http_x_header for > logformat to capture the header X.header in the access log. Does anybody > see any issues with the patch? > > --- src/http/ngx_http_variables.c.orig 2015-08-15

Re: header handling

2015-08-15 Thread Frank Liu
I made the below patch and can now use $upstream_http_x_header for logformat to capture the header X.header in the access log. Does anybody see any issues with the patch? --- src/http/ngx_http_variables.c.orig 2015-08-15 02:19:31.635328112 + +++ src/http/ngx_http_variables.c 2015-08-15 02:19:

Re: header handling

2015-08-14 Thread Frank Liu
Thanks ryd994 for the suggestion! 1 and 2 are working now. Anyone else has any ideas on 3? Frank On Fri, Aug 14, 2015 at 10:36 AM, ryd994 wrote: > Hi, > > 1) Use mapped variable > > map $http_ $ { > "" "value if nit set"; > default $http_; > } > Then you can set header with the n

Re: header handling

2015-08-14 Thread ryd994
Hi, 1) Use mapped variable map $http_ $ { "" "value if nit set"; default $http_; } Then you can set header with the new variable. 2) I guess you can use map, too. Use $upstream_http_*name* instead. 3) Sorry, I have no idea on this. On Sat, Aug 15, 2015, 00:51 Frank Liu wrote: >

header handling

2015-08-14 Thread Frank Liu
Hi, I have a few questions regarding headers in nginx: 1) I use proxy_set_header to pass a header to upstream servers. Is it possible to honor the header if the incoming request already has it? 2) I want to pass the "Server" header from upstream response to clients, and if there is no such respo