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

headers-more-nginx-module not compatible with nginx 1.19.1 #116

Open
atmecs123 opened this issue Dec 8, 2020 · 7 comments
Open

headers-more-nginx-module not compatible with nginx 1.19.1 #116

atmecs123 opened this issue Dec 8, 2020 · 7 comments

Comments

@atmecs123
Copy link

Please let us know whether the headers-more-nginx-module module is compatible with nginx 1.19.1.
It is given in the readme that it is supported upto the version 1.17.x.
I was trying to use it with 1.19.1 but is says.

module "/etc/nginx/modules/ngx_http_headers_more_filter_module.so" is not binary compatible in /etc/nginx/nginx.conf

bash-4.2# nginx -v
nginx version: nginx/1.19.1
bash-4.2#

@vmalinics0
Copy link

vmalinics0 commented Dec 9, 2020

just tested with 1.19.5, works fine
build with --add-module=/usr/local/src/headers-more-nginx-module
replace '/usr/local/src' with whatever path to module is

@agentzh
Copy link
Member

agentzh commented Dec 9, 2020

We also tested thoroughly against 1.19.3.

@chinkung
Copy link

chinkung commented Dec 22, 2020

I try to compile from master against nginx 1.19.6 and got the same error when do nginx -t

nginx: [emerg] module "/etc/nginx/modules/ngx_http_headers_more_filter_module.so" is not binary compatible in /etc/nginx/nginx.conf

I built it using these commands

git clone --branch release-1.19.6 --depth 1 https://github.com/nginx/nginx
git clone --depth 1 https://github.com/openresty/headers-more-nginx-module
cd nginx
auto/configure --add-dynamic-module=../headers-more-nginx-module
make
cp objs/ngx_http_headers_more_filter_module.so /etc/nginx/modules/

I compile on CentOS 7 and try to load it on nginx 1.19.6 mainline install from nginx official yum repo

$ nginx -V
nginx version: nginx/1.19.6
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Update:

I can now fix it by pass ALL configure arguments: from nginx -V to configure command and add --add-dynamic-module=../headers-more-nginx-module as last argument, now nginx is able to load dynamic module

auto/configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --add-dynamic-module=../headers-more-nginx-module

@webserfer
Copy link

Works with 1.19.9 (dynamic)

@soulteary
Copy link

I've test it with 1.19.7 ~ 1.19.10 / 1.20 ~ 1.21 (dynamic) , if you use docker or ubuntu/debian, you can use pre-built modules directly.

https://github.com/nginx-with-docker/ngx_http_headers_more_filter_module

@Bhuwan111
Copy link

Bhuwan111 commented Jan 28, 2022

Hello All,

Will this module work for the following version,
nginx version: nginx/1.20.1
This is not in docker environment.

@zhuizhuhaomeng
Copy link
Contributor

sure, it works

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

8 participants