Welcome! Log In Create A New Profile

Advanced

The "headers_more" module: Set and clear output headers...more than "add"!

agentzh
November 17, 2009 05:04AM
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
Subject Author Posted

The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 17, 2009 05:04AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 17, 2009 09:24PM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 18, 2009 02:54AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

agentzh November 18, 2009 05:02AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

rmalayter December 04, 2009 10:19AM

Re: The "headers_more" module: Set and clear output headers...more than "add"!

Joshua Zhu November 17, 2009 10:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 227
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready