the following code does not work as i expected in nginx-0.8.6,who can tell me why? thx
location = ngx_palloc(r->pool, strlen(url));
...
r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
...
ngx_copy(location, url, strlen(url));
r->headers_out.location->value.data = location;
r->headers_out.location->value.len = strlen(url);
r->headers_out.content_length_n = 0;
r->header_only = 1;
r->keepalive = 0;
return NGX_HTTP_MOVED_TEMPORARILY ;
the server returns the message as the following:
HTTP/1.1 302 Moved Temporarily
Server: nginx/0.8.6
Date: Tue, 25 Aug 2009 12:58:43 GMT
Content-Type: text/html
Content-Length: 160
Connection: close
Cache-Control: no-cache
no location here?why
Edited 1 time(s). Last edit at 08/25/2009 09:09AM by wangbin579.