You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
diff --git a/ngx_http_websocket_stat_module.c b/ngx_http_websocket_stat_module.c
index f74a386..b81bf2d 100644
--- a/ngx_http_websocket_stat_module.c
+++ b/ngx_http_websocket_stat_module.c
@@ -394,7 +394,7 @@ ngx_http_websocket_stat_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
template_ctx_s template_ctx;
template_ctx.ws_ctx = ctx;
- if (r->upstream->upgrade) {
+ if (r->headers_in.upgrade) {
if (r->upstream->peer.connection) {
// connection opened
ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_websocket_stat_ctx));
@JonathanHuot sorry for troubling you on such an outdated repo, but I'd appreciate if you could help me a little. I'd like to know if you guys stopped maintaining this module. If so, could you advise smth with similar functionality. I'm looking for a way to log every time a new message is sent/received over WS.
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.conf
filews_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.
The text was updated successfully, but these errors were encountered: