Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

documented the -r option.

  • Loading branch information...
commit 5cd9a384f8475fd537ab5309ebb50d1d9c171460 1 parent 0b16d5c
@agentzh agentzh authored
Showing with 25 additions and 7 deletions.
  1. +14 −4 README
  2. +11 −3 doc/readme.wiki
View
18 README
@@ -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
@@ -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.
@@ -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*
@@ -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>...*
@@ -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)
@@ -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
View
14 doc/readme.wiki
@@ -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 =
@@ -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 =
@@ -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''
@@ -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>...''
@@ -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.
@@ -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.

0 comments on commit 5cd9a38

Please sign in to comment.
Something went wrong with that request. Please try again.