headers-more-nginx-module icon indicating copy to clipboard operation
headers-more-nginx-module copied to clipboard

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

Open adimaryadi opened this issue 2 years ago • 4 comments

Anyone know why it's not compatible? I use nginx version: nginx/1.17.8

adimaryadi avatar May 17 '22 08:05 adimaryadi

@adimaryadi because you have to compile with a matching version and with --with-compat configure flag.

dvershinin avatar Jul 01 '22 22:07 dvershinin

@dvershinin I came across this "not binary compatible" error while using Nginx 1.22. I suspect the compiler flags used for the Alpine distribution differ from the flags that the Nginx team uses for the official docker image. The nginx:stable-alpine Docker image, which is based on Nginx 1.22.0-r1 and almost matches the 1.22.0-r2 version shown in the nginx-mod-http-headers-more Alpine package. Here's a minimal reproducible example:

FROM docker.io/nginx:stable-alpine
RUN apk add --no-cache \
    nginx-mod-http-headers-more
RUN echo "load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;" > /etc/nginx/nginx.conf

Error message:

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

I can work around the issue by using the nginx Alpine package, which is built by the same person who maintains the Alpine package for this repo.

FROM alpine:3.16
RUN apk add --no-cache \
    nginx \
    nginx-mod-http-headers-more
RUN echo "load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;" > /etc/nginx/nginx.conf
ENTRYPOINT [ "nginx" ]

I'm not sure if OP's issue is the same as mine because he didn't mention Alpine and is using nginx 1.17.8.

denosaurtrain avatar Jul 19 '22 18:07 denosaurtrain

@adimaryadi i bet the output of your nginx -V is missing --with-compat. you'll need an nginx binary that was compiled with that flag.

glaszig avatar Aug 23 '22 07:08 glaszig