headers-more-nginx-module
headers-more-nginx-module copied to clipboard
headers-more-nginx-module not compatible with nginx 1.19.1
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#
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
We also tested thoroughly against 1.19.3.
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
Works with 1.19.9 (dynamic)
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
Hello All,
Will this module work for the following version, nginx version: nginx/1.20.1 This is not in docker environment.
sure, it works