Skip to content

Commit 4f7aa50

Browse files
committed
feature: this module can now be compiled as a dynamic module with NGINX 1.9.11+ via the --with-dynamic-module=PATH option of ./configure.
1 parent 37a0bbc commit 4f7aa50

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

README.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,14 @@ the version 1.9.7 (see [nginx compatibility](#compatibility)), and then build th
15851585

15861586
Download the latest version of the release tarball of this module from [echo-nginx-module file list](https://github.com/openresty/echo-nginx-module/tags).
15871587

1588+
Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the
1589+
`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module)
1590+
directive, for example,
1591+
1592+
```nginx
1593+
load_module /path/to/modules/ngx_http_echo_module.so;
1594+
```
1595+
15881596
Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org).
15891597

15901598
[Back to TOC](#table-of-contents)

config

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,52 @@
11
ngx_addon_name=ngx_http_echo_module
2-
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_echo_module"
3-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_echo_module.c $ngx_addon_dir/src/ngx_http_echo_util.c $ngx_addon_dir/src/ngx_http_echo_timer.c $ngx_addon_dir/src/ngx_http_echo_var.c $ngx_addon_dir/src/ngx_http_echo_handler.c $ngx_addon_dir/src/ngx_http_echo_filter.c $ngx_addon_dir/src/ngx_http_echo_sleep.c $ngx_addon_dir/src/ngx_http_echo_location.c $ngx_addon_dir/src/ngx_http_echo_echo.c $ngx_addon_dir/src/ngx_http_echo_request_info.c $ngx_addon_dir/src/ngx_http_echo_subrequest.c $ngx_addon_dir/src/ngx_http_echo_foreach.c"
4-
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_http_echo_module.h $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_echo_handler.h $ngx_addon_dir/src/ngx_http_echo_util.h $ngx_addon_dir/src/ngx_http_echo_sleep.h $ngx_addon_dir/src/ngx_http_echo_filter.h $ngx_addon_dir/src/ngx_http_echo_var.h $ngx_addon_dir/src/ngx_http_echo_location.h $ngx_addon_dir/src/ngx_http_echo_echo.h $ngx_addon_dir/src/ngx_http_echo_request_info.h $ngx_addon_dir/src/ngx_http_echo_subrequest.h $ngx_addon_dir/src/ngx_http_echo_foreach.h"
2+
3+
ECHO_SRCS=" \
4+
$ngx_addon_dir/src/ngx_http_echo_module.c \
5+
$ngx_addon_dir/src/ngx_http_echo_util.c \
6+
$ngx_addon_dir/src/ngx_http_echo_timer.c \
7+
$ngx_addon_dir/src/ngx_http_echo_var.c \
8+
$ngx_addon_dir/src/ngx_http_echo_handler.c \
9+
$ngx_addon_dir/src/ngx_http_echo_filter.c \
10+
$ngx_addon_dir/src/ngx_http_echo_sleep.c \
11+
$ngx_addon_dir/src/ngx_http_echo_location.c \
12+
$ngx_addon_dir/src/ngx_http_echo_echo.c \
13+
$ngx_addon_dir/src/ngx_http_echo_request_info.c \
14+
$ngx_addon_dir/src/ngx_http_echo_subrequest.c \
15+
$ngx_addon_dir/src/ngx_http_echo_foreach.c \
16+
"
17+
18+
ECHO_DEPS=" \
19+
$ngx_addon_dir/src/ddebug.h \
20+
$ngx_addon_dir/src/ngx_http_echo_module.h \
21+
$ngx_addon_dir/src/ngx_http_echo_handler.h \
22+
$ngx_addon_dir/src/ngx_http_echo_util.h \
23+
$ngx_addon_dir/src/ngx_http_echo_sleep.h \
24+
$ngx_addon_dir/src/ngx_http_echo_filter.h \
25+
$ngx_addon_dir/src/ngx_http_echo_var.h \
26+
$ngx_addon_dir/src/ngx_http_echo_location.h \
27+
$ngx_addon_dir/src/ngx_http_echo_echo.h \
28+
$ngx_addon_dir/src/ngx_http_echo_request_info.h \
29+
$ngx_addon_dir/src/ngx_http_echo_subrequest.h \
30+
$ngx_addon_dir/src/ngx_http_echo_foreach.h \
31+
"
532

633
# This module depends upon the postpone filter being activated
734
if [ $HTTP_POSTPONE != YES ]; then
835
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
936
HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
1037
fi
38+
39+
if test -n "$ngx_module_link"; then
40+
ngx_module_type=HTTP_AUX_FILTER
41+
ngx_module_name=$ngx_addon_name
42+
ngx_module_incs=
43+
ngx_module_deps="$ECHO_DEPS"
44+
ngx_module_srcs="$ECHO_SRCS"
45+
ngx_module_libs=
46+
47+
. auto/module
48+
else
49+
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
50+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ECHO_SRCS"
51+
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ECHO_DEPS"
52+
fi

0 commit comments

Comments
 (0)