Hi!
I'm trying to compile custom dynamic module and use it with ingress-controller 0.44.0 (https://github.com/kubernetes/ingress-nginx/). I made a fork to slightly modify config file to compile it as a dynamic module. https://github.com/chainstack/ngx_http_websocket_stat_module
The resulting dynamic module works fine with pure nginx 1.19.6. But the problem is that when I'm trying to use with ingress-nginx image, it does nothing. No frames are logged and no errors appear:(
I know that it's not a problem of the module itself, but maybe you guys can advise me smth to look at.
This is the dockerfile I came up with to build an nginx with the dynamic module inside.
FROM k8s.gcr.io/ingress-nginx/controller:v0.44.0 as builder
USER root
WORKDIR /tmp
RUN apk add git openssl-dev pcre-dev zlib-dev libc-dev gcc make
RUN NGINX_VERSION=$(nginx -v 2>&1 | sed 's/nginx version: nginx\///') && \
wget -qO- https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | tar xvz && \
mv nginx-${NGINX_VERSION} nginx
RUN git clone --depth 1 --branch v1.0.0 https://github.com/chainstack/ngx_http_websocket_stat_module.git && \
cd ./nginx && \
./configure --with-compat --add-dynamic-module=../ngx_http_websocket_stat_module && make modules
FROM k8s.gcr.io/ingress-nginx/controller:v0.44.0
COPY --from=builder /tmp/nginx/objs/ngx_http_websocket_stat_module.so /etc/nginx/modules
The way I was testing it is the following:
- I ran docker container from the image
- Added
load_module /etc/nginx/modules/ngx_http_websocket_stat_module.so; to /etc/nginx/nginx.conf file
- Added an nginx service and location sections that accept websocket and proxies it to a dummy websocket backend.
- Finally added
ws_log* directives to the added service.
P.S.
Maybe you guys know some other way that allows to log each time frame goes through websocket connection.
Hi!
I'm trying to compile custom dynamic module and use it with ingress-controller 0.44.0 (https://github.com/kubernetes/ingress-nginx/). I made a fork to slightly modify config file to compile it as a dynamic module. https://github.com/chainstack/ngx_http_websocket_stat_module
The resulting dynamic module works fine with pure nginx 1.19.6. But the problem is that when I'm trying to use with ingress-nginx image, it does nothing. No frames are logged and no errors appear:(
I know that it's not a problem of the module itself, but maybe you guys can advise me smth to look at.
This is the dockerfile I came up with to build an nginx with the dynamic module inside.
The way I was testing it is the following:
load_module /etc/nginx/modules/ngx_http_websocket_stat_module.so;to/etc/nginx/nginx.conffilews_log*directives to the addedservice.P.S.
Maybe you guys know some other way that allows to log each time frame goes through websocket connection.