query about nginx plugin module for reverse proxy
jongsun89 at naver.com
Mon Mar 7 12:26:42 UTC 2022
Hello, nginx team.
I'm using nginx as reverse proxy .
I'm trying to make nginx plugin module(I'm noob of this) for some purpose .
I have back-server opening websocket behind nginx .
client <-> nginx(reverse proxy) <-> back-server(websocket)
back-server is listening 3 numbers of websocket.
I'd like to watch websocket(only A) connection status(connection fail/opened/closed) in nginx plugin module for some purpose.
i can catch the request websocket 'A' connection in nginx plugin module by registering NGX_HTTP_ACCESS_PHASE handler(parse header and compare subprotocol(A) of http request).
Now, how can i get the websocket connection status(connection fail/opened/closed) event with the same http request context getting from NGX_HTTP_ACCESS_PHASE handler ?
1. get websocket(A) connection request in nginx plugin module .
2. catch event in nginx plugin moudle when the request failed / opened and closed .
3. when the connection is opened or closed,i do some work .
More query :
Is the context from NGX_HTTP_ACCESS_PHASE handler valid until websocket connection closed? (ngx_http_foo_handler(ngx_http_request_t *r) <- context r )
If not , is there another context valid from http-requested to websocket connection closed?
API & simple sample code will be very helpful .
Thank you for your support
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx