1

In the JS WebSocket library, you can limit the maximum allowed incoming message size via the maxPayload option.

I'd like to impose this limit in my Nginx reverse proxy layer, before it gets to my application server.

Does Nginx have a similar concept? Does client_max_body_size (doc) apply to incoming websocket messages?

1 Answer 1

1

When nginx sees the 101 Switching Protocols response from the backend, it begins to treat the connection as an opaque tunnel and passes traffic back and forth without any further inspection. There is no directive that will limit any particular Websocket message in any way.

1
  • This is what I figured, thank you for confirming!
    – rynop
    Sep 24, 2020 at 3:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .