nginx and proxy_hide_header

Posted by giskard on Server Fault See other posts from Server Fault or by giskard
Published on 2010-03-04T16:55:56Z Indexed on 2010/03/12 0:37 UTC
Read the original article Hit count: 314

Filed under:

When I curl for a URL I get this answer back:

>
< HTTP/1.1 200 OK
< Server: nginx/0.7.65
< Date: Thu, 04 Mar 2010 12:18:27 GMT
< Content-Type: application/json
< Connection: close
< Expires: Thu, 04 Mar 2010 12:18:27 UTC
< http.context.path: /1/
< jersey.response: com.sun.jersey.spi.container.ContainerResponse@17646d60
< http.custom.headers: {Content-Type=text/plain}
< http.request.path: /2/messages/latest.json
< http.status: 200
< Transfer-Encoding: chunked

I want to remove

< http.context.path: /1/
< jersey.response: com.sun.jersey.spi.container.ContainerResponse@17646d60
< http.custom.headers: {Content-Type=text/plain}
< http.request.path: /2/messages/latest.json
< http.status: 200

So I used the proxy_hide_header directive in this way:

location / {
if ($arg_id) {
proxy_pass http..authorized;
break;
}
proxy_pass http..anonymous;
proxy_hide_header http.context.path;
proxy_hide_header jersey.response;
proxy_hide_header http.request.path;
proxy_hide_header http.status ;
}

But it doesn't work. any clues?

© Server Fault or respective owner

Related posts about nginx