push_stream_max_channel_id_length

Sets the maximum length of push stream channel IDs in NGINX.

Syntaxpush_stream_max_channel_id_length number;
Defaultnone
Contexthttp
Arguments1

Description

The push_stream_max_channel_id_length directive is used to define the maximum allowed length for channel IDs in the NGINX Push Stream Module. This setting is crucial for controlling the input size of channel identifiers, which can affect memory usage and URL lengths during requests. If the length of a channel ID exceeds the specified maximum length, the module will reject the request, ensuring that excessively long identifiers do not cause performance or security issues.

When configuring this directive, administrators should consider typical use cases for channel IDs in their applications. For instance, if the channel IDs are derived from user input or other dynamic sources, it's important to set an appropriate limit that allows for descriptive identifiers without risking abuse. The directive only accepts a numerical argument, which represents the maximum character count for channel IDs. The module enforces this limit during the request handling process, providing feedback to the client if the ID is too long.

Because of its effect on channel management, this directive should be set at the http level, making it available to all server contexts defined within it. This facilitates centralized control over channel ID management across various virtual hosts or locations handled by the same NGINX instance.

Config Example

http {
    push_stream_max_channel_id_length 64;
    
    server {
        location /pub {
            push_stream_publisher admin;
            push_stream_channels_path $arg_id;
        }
    }
}

Setting this value too low can prevent legitimate channel IDs from being accepted by the server.

Incorrectly configuring this directive may lead to unexpected errors for clients trying to access channels with valid yet longer identifiers.

← Back to all directives