Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
git-svn-id: http://substitutions4nginx.googlecode.com/svn/trunk@2 184bbb60-1f5e-11de-b650-e715bd6d7cf1
  • Loading branch information
yaoweibin committed Apr 2, 2009
1 parent b70b15e commit 5e2f2b1
Show file tree
Hide file tree
Showing 4 changed files with 1,516 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Changes with nginx_substitutions_filter 0.3 2009-02-04

*) Initial public release
47 changes: 47 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
nginx_substitutions_filter
-------

nginx_substitutions_filter is a filter module which can do both regular
expression and fixed string substitutions on response bodies. This module is
quite different from the Nginx's Substitution Module. It scans the output
chains buffer and matches string line by line, just like Apache's
mod_substitute.

To install, compile nginx with the following option:

--add-module=/path/to/this/directory

EXAMPLE

subs_filter_types text/html text/css text/xml;
subs_filter http://st(\\d*).example.com http://s.example.com ir;
subs_filter http://a.example.com http://s.example.com;

DIRECTIVES

subs_filter_types

syntax: subs_filter_types mime-type [mime-type ...]
default: subs_filter_types text/html
context: http, server, location
description: subs_filter_types is used to specify which content types should
be checked for subs_filter. The default is only text/html.


subs_filter

syntax: subs_filter source_str destination_str [gior]
default: none
context: http, server, location
description: subs_filter allows replacing source stringe(regular expression
or fixed) in the nginx response with destination string. Substitution
text may contain variables. More than one substitution rules per
location is supported.
The meaning of the third flags are:
g(default): Replace all the match strings.
i: Perform a case-insensitive match.
o: Just replace the first one.
r: The pattern is treated as a regular expression, default is fixed
string.

Questions/patches may be directed to Weibin Yao, yaoweibin@gmail.com.
3 changes: 3 additions & 0 deletions config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ngx_addon_name=ngx_http_subs_filter_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_subs_filter_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_subs_filter_module.c"
Loading

0 comments on commit 5e2f2b1

Please sign in to comment.