Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dynamically loadable module #234

Open
tsgan opened this issue Aug 12, 2020 · 4 comments
Open

Make dynamically loadable module #234

tsgan opened this issue Aug 12, 2020 · 4 comments

Comments

@tsgan
Copy link

tsgan commented Aug 12, 2020

Is it possible to make upstream check module as dynamically loadable module that works with nginx-1.18.x?

thanks,

@malza321
Copy link

hi!
did you make it?

I have the same issue with you..

@tsgan
Copy link
Author

tsgan commented May 24, 2021

no, it doesn't work as dynamic module

@malza321
Copy link

no, it doesn't work as dynamic module

omg :(

@0xDones
Copy link

0xDones commented Feb 6, 2023

@tsgan @malza321 I was able to compile it as a dynamic module by updating this module's config file with the content from this comment.

nginx_upstream_check_module/config

ngx_feature="ngx_http_upstream_check_module"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path="$ngx_addon_dir"
ngx_feature_deps="$ngx_addon_dir/ngx_http_upstream_check_module.h"
ngx_check_src="$ngx_addon_dir/ngx_http_upstream_check_module.c"
ngx_feature_test="int a;"
. auto/feature

ngx_addon_name=ngx_http_upstream_check_module
ngx_module_incs=$ngx_addon_dir

if test -n "$ngx_module_link"; then
    ngx_module_type="HTTP"
    ngx_module_name="ngx_http_upstream_check_module"
    ngx_module_srcs="$ngx_addon_dir/ngx_http_upstream_check_module.c"
    ngx_module_deps="$ngx_addon_dir/ngx_http_upstream_check_module.h"

    . auto/module
else
    have=NGX_HTTP_UPSTREAM_CHECK . auto/have
    HTTP_MODULES="$HTTP_MODULES ngx_http_upstream_check_module"
    NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_feature_deps"
    NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_check_src"
    CORE_INCS="$CORE_INCS $ngx_feature_path"
fi

Building module

cd <nginx source code dir>
./configure --with-compat --add-dynamic-module="<path>/nginx_upstream_check_module"
make modules
ls -la objs

pexcn added a commit to pexcn/ngx_upstream_check that referenced this issue Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants