(52) Empty reply from server
Pankaj Chaudhary
pankajitbhu at gmail.com
Wed Apr 20 07:24:13 UTC 2016
>>But your code snippet does not match exactly the types and return values
>>of that example. I don't know if that is something worth investigating.
I have tried to change match exactly the types and return values
of that example. but below is response curl: (52) Empty reply from server
>>Also, you may be able to make use of #3: "Blazing fast" instead.
but same response
>>And one final thing - I suspect that the request header "Cookie" will
>>be presented in the header_in structure under the name "cookie", not
>>the name "http_cookie". Possibly just making that change will cause your
>>code to find the value you want.
Tried to use the same now i am getting response only one word "cookie"
I have used below example to set custom header
ngx_int_tset_custom_header_in_headers_out(ngx_http_request_t *r,
ngx_str_t *key, ngx_str_t *value) {
ngx_table_elt_t *h;
/* All we have to do is just to allocate the header... */
h = ngx_list_push(&r->headers_out.headers);
if (h == NULL) {
return NGX_ERROR;
}
/* ... setup the header key ... */
h->key = *key;
/* ... and the value. */
h->value = *value;
/* Mark the header as not deleted. */
h->hash = 1;
return NGX_OK;}
below is "curl -i" response
HTTP/1.1 200 OK
Server: nginx/1.9.12
Date: Wed, 20 Apr 2016 15:25:20 GMT
Content-Type: text/plain
Content-Length: 14
Connection: keep-alive
cookie: thisitestvalue
user_agent: 10.9 user
get-rese: Cookie
On Tue, Apr 19, 2016 at 11:12 PM, Francis Daly <francis at daoine.org> wrote:
> On Tue, Apr 19, 2016 at 03:51:17PM +0530, Pankaj Chaudhary wrote:
>
> Hi there,
>
> > i am trying to search for one header with the specified name
> >
> > i am not able to get header value .
>
>
> https://www.nginx.com/resources/wiki/start/topics/examples/headers_management/
> lists four ways to try this. You are using something like #2: "Quick
> search".
>
> But your code snippet does not match exactly the types and return values
> of that example. I don't know if that is something worth investigating.
>
> Also, you may be able to make use of #3: "Blazing fast" instead.
>
> > ngx_str_t val = ngx_string("http_cookie");
>
> And one final thing - I suspect that the request header "Cookie" will
> be presented in the header_in structure under the name "cookie", not
> the name "http_cookie". Possibly just making that change will cause your
> code to find the value you want.
>
> Good luck with it,
>
> f
> --
> Francis Daly francis at daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160420/68dce249/attachment.html>
More information about the nginx
mailing list