Modifying response body

Joe Van Dyk joe at pinkpucker.net
Wed May 6 23:49:30 MSD 2009


On Wed, May 6, 2009 at 12:02 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Wed, May 06, 2009 at 08:57:31AM -0700, Joe Van Dyk wrote:
>
> > 2 questions:
> > Is it possible to return an empty response?  i.e.
> >   location /empty-response {
> >     add_header("some-header", "foo-bar");
> >     # nothing in response body
> >   }
>
> Something like
>
>    location /empty-response {
>        add_header ...;
>        return 204;
>    }
>
> should work for http-complaint applications (but not some popular
> browsers).


I earlier tried returning a 200 and it seemed to hang on me.  Maybe browser
problem?


>  > Is it possible have the response body be only the unique id set by the
> > userid module?  i.e.
> >   userid on;
> >   location /unique-id {
> >     # response body should be "uid=<cookie's uid>"
> >   }
>
> Either use embedded perl or try http_response module by Kirill
> Korinskiy (http://catap.ru/downloads/nginx/ngx_http_response-0.3.tar.gz).


Thanks.  I think I will just proxy the request to a Sinatra app, even though
I'm losing a lot of performance.  Is that module for nginx 0.6.x?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090506/4ba05178/attachment.html>


More information about the nginx mailing list