<div dir="ltr"><span style="font-size:12.8px">>>But your code snippet does not match exactly the types and return values</span><br style="font-size:12.8px"><span style="font-size:12.8px">>>of that example. I don't know if that is something worth investigating.</span><br><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I have tried to change match exactly the types and return values</span></div><span style="font-size:12.8px">of that example. but below is response curl: (52) Empty reply from server</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">>>Also, you may be able to make use of #3: "Blazing fast" instead.</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">but same response </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">>>And one final thing - I suspect that the request header "Cookie" will</span><br style="font-size:12.8px"><span style="font-size:12.8px">>></span><span style="font-size:12.8px">be presented in the header_in structure under the name "cookie", not</span><br style="font-size:12.8px"><span style="font-size:12.8px">>></span><span style="font-size:12.8px">the name "http_cookie". Possibly just making that change will cause your</span><br style="font-size:12.8px"><span style="font-size:12.8px">>></span><span style="font-size:12.8px">code to find the value you want.</span></div><div><br></div><div><span style="font-size:12.8px">Tried to use the same now i am getting response only one word "cookie"</span></div><div><span style="font-size:12.8px">I have used below example to set custom header</span></div><div><span style="font-size:12.8px"><br></span></div><div><pre style="overflow:auto;font-family:'Courier 10 Pitch',Courier,monospace;font-size:0.9em;padding:7px 30px;margin-top:15px;margin-bottom:15px;line-height:1.3em;color:rgb(51,51,51);word-wrap:break-word;border:1px solid rgb(204,204,204);border-radius:4px;outline:0px;vertical-align:baseline;max-width:100%;white-space:pre-wrap;background:none 0px 0px repeat scroll rgb(238,238,238)!important"><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(144,32,0)">ngx_int_t</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(6,40,126)">set_custom_header_in_headers_out</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">(</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(144,32,0)">ngx_http_request_t</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">r</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">,</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(144,32,0)">ngx_str_t</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">key</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">,</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(144,32,0)">ngx_str_t</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">value</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">)</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">{</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(144,32,0)">ngx_table_elt_t</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)">/*</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> All we have to do is just to allocate the header...</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> */</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">=</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">ngx_list_push</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">(</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">&</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">r</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">-></span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">headers_out</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">.</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">headers</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">);</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:bold;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,112,32)">if</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">(</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">==</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,112,32)">NULL</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">)</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">{</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:bold;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,112,32)">return</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">NGX_ERROR</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">}</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)">/*</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> ... setup the header key ...</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> */</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">-></span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">key</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">=</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">key</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)">/*</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> ... and the value.</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> */</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">-></span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">value</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">=</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">*</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">value</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)">/*</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> Mark the header as not deleted.</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:italic;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(64,128,144)"> */</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">h</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">-></span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">hash</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(102,102,102)">=</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(32,128,80)">1</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:bold;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,112,32)">return</span> <span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">NGX_OK</span><span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">;</span>
<span class="" style="border:0px;font-family:inherit;font-size:14.4px;font-style:inherit;font-weight:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline">}</span></pre></div><div><span style="font-size:12.8px">below is "curl -i" response</span></div><div><span style="font-size:12.8px"><br></span></div><div><div style=""><span style="font-size:12.8px">HTTP/1.1 200 OK</span></div><div style=""><span style="font-size:12.8px">Server: nginx/1.9.12</span></div><div style=""><span style="font-size:12.8px">Date: Wed, 20 Apr 2016 15:25:20 GMT</span></div><div style=""><span style="font-size:12.8px">Content-Type: text/plain</span></div><div style=""><span style="font-size:12.8px">Content-Length: 14</span></div><div style=""><span style="font-size:12.8px">Connection: keep-alive</span></div><div style=""><span style="font-size:12.8px">cookie: thisitestvalue</span></div><div style=""><span style="font-size:12.8px">user_agent: 10.9 user</span></div><div style=""><span style="font-size:12.8px">get-rese: Cookie</span></div><div style="font-size:12.8px"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 11:12 PM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 19, 2016 at 03:51:17PM +0530, Pankaj Chaudhary wrote:<br>
<br>
Hi there,<br>
<br>
</span><span class="">> i am trying to search for one header with the specified name<br>
><br>
> i am not able to get header value .<br>
<br>
</span><a href="https://www.nginx.com/resources/wiki/start/topics/examples/headers_management/" rel="noreferrer" target="_blank">https://www.nginx.com/resources/wiki/start/topics/examples/headers_management/</a><br>
lists four ways to try this. You are using something like #2: "Quick<br>
search".<br>
<br>
But your code snippet does not match exactly the types and return values<br>
of that example. I don't know if that is something worth investigating.<br>
<br>
Also, you may be able to make use of #3: "Blazing fast" instead.<br>
<span class=""><br>
> ngx_str_t val = ngx_string("http_cookie");<br>
<br>
</span>And one final thing - I suspect that the request header "Cookie" will<br>
be presented in the header_in structure under the name "cookie", not<br>
the name "http_cookie". Possibly just making that change will cause your<br>
code to find the value you want.<br>
<div class="HOEnZb"><div class="h5"><br>
Good luck with it,<br>
<br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>