Navigation Menu

Skip to content

Commit

Permalink
documented the -r option.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Mar 12, 2010
1 parent 0b16d5c commit 5cd9a38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
18 changes: 14 additions & 4 deletions README
Expand Up @@ -6,9 +6,9 @@ Name
installation instructions.

Version
This document describes headers-more-nginx-module v0.07
This document describes headers-more-nginx-module v0.08
(<http://github.com/agentzh/headers-more-nginx-module/downloads>)
released on Dec 24, 2009.
released on March 12, 2010.

Synopsis
# set the Server output header
Expand Down Expand Up @@ -40,6 +40,9 @@ Synopsis
# ...
}

# replace input header X-Foo *only* if it already exists
more_set_input_headers -r 'X-Foo: howdy';

Description
This module allows you to add, set, or clear any output or input header
that you specify.
Expand Down Expand Up @@ -156,7 +159,7 @@ Directives
See more_set_headers for more details.

more_set_input_headers
syntax: *more_set_input_headers [-t <content-type list>]...
syntax: *more_set_input_headers [-r] [-t <content-type list>]...
<new-header>...*

default: *no*
Expand All @@ -172,6 +175,9 @@ Directives
always run at the *end* of the "rewrite" so that it runs *after* the
standard rewrite module and works in subrequests as well.

If the "-r" option is specified, then the headers will be replaced to
the new values *only if* they already exist.

more_clear_input_headers
syntax: *more_clear_input_headers [-t <content-type list>]...
<new-header>...*
Expand Down Expand Up @@ -225,7 +231,7 @@ Installation
Compatibility
The following versions of Nginx should work with this module:

* 0.8.x (last tested version is 0.8.31)
* 0.8.x (last tested version is 0.8.34)

* 0.7.x >= 0.7.44 (last tested version is 0.7.64)

Expand All @@ -250,6 +256,10 @@ Source Repository
(<http://github.com/agentzh/headers-more-nginx-module>).

ChangeLog
v0.08
* applied the patch from Bernd Dorn to add the "-r" option to the
more_set_input_headers directive.

v0.07
* fixed the more_clear_headers directive for builtin headers like
"Server" and "Last-Modified" by always inserting an empty header
Expand Down
14 changes: 11 additions & 3 deletions doc/readme.wiki
Expand Up @@ -6,7 +6,7 @@

= Version =

This document describes headers-more-nginx-module [http://github.com/agentzh/headers-more-nginx-module/downloads v0.07] released on Dec 24, 2009.
This document describes headers-more-nginx-module [http://github.com/agentzh/headers-more-nginx-module/downloads v0.08] released on March 12, 2010.

= Synopsis =

Expand Down Expand Up @@ -39,6 +39,9 @@ This document describes headers-more-nginx-module [http://github.com/agentzh/hea
# now $host and $http_host have their new values...
# ...
}
# replace input header X-Foo *only* if it already exists
more_set_input_headers -r 'X-Foo: howdy';
</geshi>

= Description =
Expand Down Expand Up @@ -167,7 +170,7 @@ or
See [[#more_set_headers|more_set_headers]] for more details.

== more_set_input_headers ==
'''syntax:''' ''more_set_input_headers [-t <content-type list>]... <new-header>...''
'''syntax:''' ''more_set_input_headers [-r] [-t <content-type list>]... <new-header>...''

'''default:''' ''no''

Expand All @@ -177,6 +180,8 @@ Very much like [[#more_set_headers|more_set_headers]] except that it operates on

Behind the scene, use of this directive and its friend [[#more_clear_input_headers|more_clear_input_headers]] will (lazily) register a <code>rewrite phase</code> handler that modifies <code>r->headers_in</code> the way you specify. Note that it always run at the ''end'' of the <code>rewrite</code> so that it runs ''after'' the standard [[NginxHttpRewriteModule|rewrite module]] and works in subrequests as well.

If the <code>-r</code> option is specified, then the headers will be replaced to the new values ''only if'' they already exist.

== more_clear_input_headers ==
'''syntax:''' ''more_clear_input_headers [-t <content-type list>]... <new-header>...''

Expand Down Expand Up @@ -234,7 +239,7 @@ Download the latest version of the release tarball of this module from [http://g

The following versions of Nginx should work with this module:

* '''0.8.x''' (last tested version is 0.8.31)
* '''0.8.x''' (last tested version is 0.8.34)
* '''0.7.x >= 0.7.44''' (last tested version is 0.7.64)
Earlier versions of Nginx like 0.6.x and 0.5.x will ''not'' work.
Expand All @@ -254,6 +259,9 @@ Available on github at [http://github.com/agentzh/headers-more-nginx-module agen

= ChangeLog =

== v0.08 ==
* applied the patch from Bernd Dorn to add the <code>-r</code> option to the [[#more_set_input_headers|more_set_input_headers]] directive.
== v0.07 ==
* fixed the [[#more_clear_headers|more_clear_headers]] directive for builtin headers like <code>Server</code> and <code>Last-Modified</code> by always inserting an empty header when absent. Thanks Sebastiaan Deckers for reporting it.
Expand Down

0 comments on commit 5cd9a38

Please sign in to comment.