Welcome! Log In Create A New Profile


query about nginx plugin module for reverse proxy

March 07, 2022 07:32AM
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.
- websocket(A)
- websocket(B)
- websocket(C)
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).
Query :
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 ?
scenario :
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
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

query about nginx plugin module for reverse proxy

백종선 March 07, 2022 07:32AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready