The "headers_more" module: Set and clear output headers...more than "add"!
Joshua Zhu
zhuzhaoyuan at gmail.com
Wed Nov 18 06:12:46 MSK 2009
Hey agentzh,
Very nice module. Good job and thanks!
On Tue, Nov 17, 2009 at 6:00 PM, agentzh <agentzh at gmail.com> wrote:
> Hi, folks!
>
> After two days' work, I've now got the "headers_more" module passing
> the its own test suite. This is an enhanced version of the standard
> "headers" module because it provides more utilities like resetting or
> clearing output headers. Builtin headers, like "Content-Type",
> "Content-Length", and "Server", are also manipulatable ;)
>
> It also allows you to specify an optional HTTP status code criteria
> using the -s option and an optional content type criteria using the -t
> option.
>
> Here's some random use cases:
>
> more_set_headers 'Server: my-server';
>
> location /foo {
> more_set_headers 'X-MyHeader: blah' 'X-MyHeader2: foo';
> more_set_headers -t 'text/plain text/css' 'Content-Type: text/foo';
> more_set_headers -s '400 404 500 503' 'Foo: Bar';
> more_clear_headers 'Transfer-Encoding' 'Content-Type';
> }
>
> location /type {
> more_set_headers 'Content-Type: text/plain';
> }
>
> One important TODO is to allow variables within the new headers'
> values. That's where "headers_more" is "less" than the standard
> "headers" module :P
>
> The Git source repository is here:
>
> http://github.com/agentzh/headers-more-nginx-module
>
> And you're recommended to use the tarballs for the tagged releases:
>
> http://github.com/agentzh/headers-more-nginx-module/downloads
>
> Don't hesitate to report any issues that you find ;)
>
> Enjoy!
> -agentzh
>
>
--
Joshua Zhu
http://www.zhuzhaoyuan.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20091118/16b3b442/attachment.html>
More information about the nginx
mailing list