Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 53 additions & 31 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,7 @@ fi



if [ $ngx_found = yes ]; then
# from: https://github.com/openresty/lua-nginx-module/blob/master/config#L56
# this is a hack to persuade nginx's build system to favor
# the paths set by our user environments:
CFLAGS="$ngx_modsecurity_opt_I $CFLAGS"
NGX_LD_OPT="$ngx_modsecurity_opt_L $NGX_LD_OPT"

CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
else
if [ $ngx_found = no ]; then
cat << END
$0: error: ngx_http_modsecurity requires the ModSecurity library.
END
Expand All @@ -79,24 +70,55 @@ fi


ngx_addon_name=ngx_http_modsecurity
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_modsecurity"
NGX_ADDON_SRCS="\
$NGX_ADDON_SRCS \
$ngx_addon_dir/src/ngx_http_modsecurity_module.c \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.c \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_log.c \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.c \
"

NGX_ADDON_DEPS="\
$NGX_ADDON_DEPS \
$ngx_addon_dir/src/ddebug.h \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.h \
$ngx_addon_dir/src/ngx_http_modsecurity_common.h \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.h \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_log.h \
"

if test -n "$ngx_module_link"; then
ngx_module_type=HTTP_AUX_FILTER
ngx_module_name=ngx_http_modsecurity
ngx_module_srcs="$ngx_addon_dir/src/ngx_http_modsecurity_module.c \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.c \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_log.c \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.c \
"
ngx_module_deps="$ngx_addon_dir/src/ddebug.h \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.h \
$ngx_addon_dir/src/ngx_http_modsecurity_common.h \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.h \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_log.h \
"
ngx_module_libs="$ngx_feature_libs"
ngx_module_incs="$ngx_feature_path"

. auto/module
else
CFLAGS="$ngx_modsecurity_opt_I $CFLAGS"
NGX_LD_OPT="$ngx_modsecurity_opt_L $NGX_LD_OPT"

CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"

HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_modsecurity"
NGX_ADDON_SRCS="\
$NGX_ADDON_SRCS \
$ngx_addon_dir/src/ngx_http_modsecurity_module.c \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.c \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.c \
$ngx_addon_dir/src/ngx_http_modsecurity_log.c \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.c \
"

NGX_ADDON_DEPS="\
$NGX_ADDON_DEPS \
$ngx_addon_dir/src/ddebug.h \
$ngx_addon_dir/src/ngx_http_modsecurity_rewrite.h \
$ngx_addon_dir/src/ngx_http_modsecurity_common.h \
$ngx_addon_dir/src/ngx_http_modsecurity_pre_access.h \
$ngx_addon_dir/src/ngx_http_modsecurity_header_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.h \
$ngx_addon_dir/src/ngx_http_modsecurity_log.h \
"
fi