Scalable, flexible pub/sub server for the modern web
151 — 所有核心与模块指令——语法、默认值、上下文与真实配置示例。
nchan_access_control_allow_credentials
nchan_access_control_allow_credentials 指令控制是否允许通过 Nchan 发出的跨源请求携带凭据。
httpserverlocation
nchan_access_control_allow_origin
`nchan_access_control_allow_origin` 指令为 Nchan 订阅者设置…
httpserverlocation
nchan_authorize_request
nchan_authorize_request 指令用于根据授权规则控制对 Nchan 频道的访问。
serverlocationif in location
nchan_benchmark
`nchan_benchmark` 指令在特定的 location 上下文中启用基准测试工具,用于测试和评估 Nchan pub/sub 服务器的性能。
location
nchan_benchmark_channels
nchan_benchmark_channels 指令在 Nchan 中设置用于基准测试的要模拟的通道数量。
location
nchan_benchmark_message_padding_bytes
nchan_benchmark_message_padding_bytes 指令为 Nchan 中的消息设置固定的填充字节数,以便进行基准测试。
location
nchan_benchmark_messages_per_channel_per_minute
指令 `nchan_benchmark_messages_per_channel_per_minute`…
location
nchan_benchmark_publisher_distribution
nchan_benchmark_publisher_distribution 指令在 Nchan 配置中控制已发布消息在可用发布通道之间的分配。
location
nchan_benchmark_subscriber_distribution
nchan_benchmark_subscriber_distribution 指令配置在 Nchan 模块中用于负载测试时订阅者连接在各通道之间的分布方式。
location
nchan_benchmark_subscribers_per_channel
指令 `nchan_benchmark_subscribers_per_channel` 在 Nchan 模块中设置每个频道的最大并发订阅者数。
location
nchan_benchmark_time
该 `nchan_benchmark_time` 指令用于配置 Nchan 模块中基准测试的时间间隔。
location
nchan_channel_event_string
指令 `nchan_channel_event_string` 允许您为特定的 Nchan 通道定义自定义事件字符串。
serverlocationif in location
nchan_channel_events_channel_id
nchan_channel_events_channel_id 指令指定用于 Nchan 的 pub/sub 功能的通道标识符。
serverlocationif in location
nchan_channel_group
nchan_channel_group 指令为相关的 pub/sub 消息通道定义了一个唯一的组标识符。
serverlocationif in location
nchan_channel_group_accounting
该 `nchan_channel_group_accounting` 指令在 Nchan 模块中为特定频道组启用资源限制和使用统计。
serverlocation
nchan_channel_id
nchan_channel_id 指令定义了 Nchan 配置中发布/订阅通道的标识符。
serverlocationif in location
nchan_channel_id_split_delimiter
指令 `nchan_channel_id_split_delimiter` 指定了在 Nchan 的 pub/sub 消息架构中用于拆分频道 ID 的分隔符。
serverlocationif in location
nchan_channel_timeout
为 Nchan 通道设置超时,使不活动的通道在指定时间后自动关闭。
httpserverlocation
nchan_deflate_message_for_websocket
nchan_deflate_message_for_websocket 指令启用通过 Nchan 模块对 WebSocket 连接的消息压缩。
serverlocation
nchan_eventsource_event
`nchan_eventsource_event` 指令指定了 Nchan pub/sub 系统中用于服务器发送事件 (SSE) 的事件数据。
serverlocationif in location
nchan_eventsource_ping_comment
指令 `nchan_eventsource_ping_comment` 在用于 EventSource 流的持久连接期间向客户端发送可选的 ping 注释。
serverlocationif in location
nchan_eventsource_ping_data
指令 `nchan_eventsource_ping_data` 指定在使用 EventSource 协议向订阅者发送的保活 ping 时的数据负载。
serverlocationif in location
nchan_eventsource_ping_event
为 NGINX 的 Nchan 模块中的 EventSource 连接设置 ping 事件间隔。
serverlocationif in location
nchan_eventsource_ping_interval
设置通过 EventSource 连接向客户端发送 ping 消息的间隔。
serverlocationif in location
nchan_group_location
`nchan_group_location` 指令定义了一个 location 块,用于指定在 Nchan 中进行 pub/sub 操作的一组通道。
location
nchan_group_max_channels
指令 `nchan_group_max_channels` 在 Nchan 中设置组内允许的 pub/sub 通道的最大数量上限。
location
nchan_group_max_messages
指令 `nchan_group_max_messages` 限制 Nchan 中通道组内保留的最大消息数。
location
nchan_group_max_messages_disk
指令 `nchan_group_max_messages_disk` 限制一个通道组在磁盘上可存储的消息数量。
location
nchan_group_max_messages_memory
`nchan_group_max_messages_memory` 指令为特定的发布/订阅频道组设置可在内存中存储的最大消息数限制。
location
nchan_group_max_subscribers
限制 Nchan 中特定 pub/sub 频道的最大订阅者数。
location
nchan_longpoll_multipart_response
指令 `nchan_longpoll_multipart_response` 指定在 Nchan 中是否对长轮询订阅者使用 multipart 响应。
serverlocationif in location
nchan_max_channel_id_length
设置 Nchan pub/sub 模块中使用的 channel ID 的最大长度。
httpserverlocation
nchan_max_channel_subscribers
设置 Nchan 中某个通道可连接的最大订阅者数量。
httpserverlocation
nchan_max_reserved_memory
设置 Nchan 在消息发布和订阅过程中为保留缓冲区分配的最大内存量。
http
nchan_message_buffer_length
设置在 Nchan 消息缓冲区中保留的最大消息数量。
httpserverlocation
nchan_message_max_buffer_length
`nchan_message_max_buffer_length` 指令设置通道消息缓冲区的最大长度。
httpserverlocation
nchan_message_temp_path
The nchan_message_temp_path 指令指定在 Nchan 中用于存储消息的临时文件目录。
http
nchan_message_timeout
设置 Nchan pub/sub 服务器中消息的超时时长。
httpserverlocation
nchan_permessage_deflate_compression_level
设置 NCHAN 中 WebSocket 消息的 gzip 压缩级别。
http
nchan_permessage_deflate_compression_memlevel
此指令为 Nchan WebSocket 通信中的 per-message deflate 压缩设置内存等级参数。
http
nchan_permessage_deflate_compression_strategy
为 Nchan 中的 WebSocket 消息配置压缩策略。
http
nchan_permessage_deflate_compression_window
nchan_permessage_deflate_compression_window 指令配置 Nchan 模块中用于 WebSocket…
http
nchan_pub_channel_id
'nchan_pub_channel_id' 指令指定在 Nchan 模块中用于 Pub/Sub 应用的发布通道的标识符。
serverlocationif in location
nchan_publisher
`nchan_publisher` 指令定义了在 Nchan 模块中用于发布消息的频道标识。
serverlocationif in location
nchan_publisher_channel_id
`nchan_publisher_channel_id` 指令设置 Nchan 发布者使用的通道标识符。
serverlocationif in location
nchan_publisher_location
定义 NCHAN 发布/订阅系统中用于发布消息的位置。
serverlocationif in location
nchan_publisher_upstream_request
`nchan_publisher_upstream_request` 指令指定了一个 URL,该 URL 在向 Nchan 频道发布消息时用于上游请求。
serverlocationif in location
nchan_pubsub
指令 `nchan_pubsub` 在 NGINX 中启用并配置用于处理实时消息传递的发布/订阅机制。
serverlocationif in location
nchan_pubsub_channel_id
指令 `nchan_pubsub_channel_id` 在 NGINX Nchan 模块中定义了发布-订阅通道的唯一标识符。
serverlocationif in location
nchan_pubsub_location
`nchan_pubsub_location` 指令配置一个 location 块,用于通过 Nchan 模块发布和订阅频道。
serverlocationif in location
nchan_redis_accurate_subscriber_count
指令 'nchan_redis_accurate_subscriber_count' 在使用 Redis 作为 Nchan…
upstream
nchan_redis_cluster_check_interval
设置在 Nchan Redis 集群中检查节点健康状况的间隔。
upstream
nchan_redis_cluster_check_interval_backoff
`nchan_redis_cluster_check_interval_backoff` 指令控制 Nchan Redis 集群设置中对 Redis…
upstream
nchan_redis_cluster_check_interval_jitter
配置添加到 Redis 集群健康检查间隔的抖动。
upstream
nchan_redis_cluster_check_interval_max
设置 Nchan 中 Redis 集群健康检查的最大间隔。
upstream
nchan_redis_cluster_check_interval_min
在 Nchan 模块中为 Redis 集群设置健康检查的最小间隔。
upstream
nchan_redis_cluster_connect_timeout
为 Nchan 中与 Redis 集群的连接设置连接超时。
upstream
nchan_redis_cluster_max_failing_time
指令 `nchan_redis_cluster_max_failing_time` 用于在 Nchan 中为处理 pub/sub 消息的 Redis…
upstream
nchan_redis_cluster_recovery_delay
在连接断开时,为 Redis 集群中 Nchan 订阅者的恢复设置延迟。
upstream
nchan_redis_cluster_recovery_delay_backoff
在节点变为不可达时,为 Redis 集群的恢复尝试设置退避延迟。
upstream
nchan_redis_cluster_recovery_delay_jitter
控制 Nchan pub/sub 场景下 Redis 集群恢复期间的抖动延迟。
upstream
nchan_redis_cluster_recovery_delay_max
限制 Nchan 模块在 Redis 集群故障后恢复的最大延迟。
upstream
nchan_redis_cluster_recovery_delay_min
nchan_redis_cluster_recovery_delay_min 指令指定了在 Nchan 中 Redis cluster…
upstream
nchan_redis_command_timeout
nchan_redis_command_timeout 指令设置由 Nchan 模块发送到 Redis 的命令的超时时间。
upstream
nchan_redis_connect_timeout
指令 `nchan_redis_connect_timeout` 指定在使用 Nchan 进行发布/订阅时连接到 Redis 服务器的超时时间。
upstream
nchan_redis_discovered_ip_range_blacklist
nchan_redis_discovered_ip_range_blacklist 指令定义了在 Nchan 的 pub/sub 操作中被列入黑名单以限制…
upstream
nchan_redis_fakesub_timer_interval
指令 `nchan_redis_fakesub_timer_interval` 设置在 Nchan 的发布/订阅功能中通过 Redis 发送伪订阅者事件的间隔。
http
nchan_redis_idle_channel_cache_timeout
设置用于 Nchan 的 Redis 中缓存空闲频道的超时。
httpserverlocation
nchan_redis_idle_channel_keepalive_backoff
指令 `nchan_redis_idle_channel_keepalive_backoff` 控制用于维持空闲 Redis pub/sub…
upstream
nchan_redis_idle_channel_keepalive_jitter
nchan_redis_idle_channel_keepalive_jitter 指令向 Redis 中空闲通道的 keepalive…
upstream
nchan_redis_idle_channel_keepalive_max
为 Nchan 中的 Redis 通道配置最大空闲时长,以提高资源利用效率。
upstream
nchan_redis_idle_channel_keepalive_min
nchan_redis_idle_channel_keepalive_min 指令为 Nchan 模块在 Redis 中的空闲通道设置最小…
upstream
nchan_redis_idle_channel_keepalive_safety_margin
指令 `nchan_redis_idle_channel_keepalive_safety_margin` 定义了在空闲期间保持 Redis…
upstream
nchan_redis_load_scripts_unconditionally
当使用 Nchan 模块时,`nchan_redis_load_scripts_unconditionally` 指令保证在不进行条件检查的情况下将 Lua…
upstream
nchan_redis_namespace
`nchan_redis_namespace` 指令为 Redis 定义了一个命名空间,以更有效地组织 pub/sub 通道。
httpserverlocation
nchan_redis_node_connect_timeout
设置 Nchan 的 pub/sub 系统中连接 Redis 节点的超时时间。
upstream
nchan_redis_nostore_fastpublish
`nchan_redis_nostore_fastpublish` 指令配置 Nchan,以允许快速发布消息而不将其存储在 Redis 中。
httpserverupstream
nchan_redis_optimize_target
在 Nchan 模块中使用 Redis 时,`nchan_redis_optimize_target` 指令指定通道数据存储的优化目标。
upstream
nchan_redis_pass
`nchan_redis_pass` 指令将已发布的消息路由到 Redis 后端,以便在可扩展的 pub/sub 系统中进行存储和检索。
httpserverlocation
nchan_redis_pass_inheritable
`nchan_redis_pass_inheritable` 指令使 Redis 连接设置在 NGINX 中可从父上下文继承。
httpserverlocation
nchan_redis_password
'nchan_redis_password' 指令指定与 Redis 实例进行身份验证以用于 Nchan 消息存储所需的密码。
upstream
nchan_redis_ping_interval
指令 `nchan_redis_ping_interval` 设置 Nchan 向 Redis 服务器发送 ping 以维持连接的时间间隔。
httpserverlocation
nchan_redis_publish_msgpacked_max_size
指令 'nchan_redis_publish_msgpacked_max_size' 在使用 MessagePack 序列化进行 Redis…
http
nchan_redis_reconnect_delay
设置在 Nchan 的基于 Redis 的 pub/sub 设置中,当连接丢失后重新连接到 Redis 的延迟(以秒为单位)。
upstream
nchan_redis_reconnect_delay_backoff
控制在为 Nchan 的 pub/sub 操作重新连接到 Redis 时的退避延迟。
upstream
nchan_redis_reconnect_delay_jitter
在 Nchan 中,`nchan_redis_reconnect_delay_jitter` 指令在与 Redis 服务器建立连接时,为重连延迟引入随机抖动。
upstream
nchan_redis_reconnect_delay_max
设置在使用 Nchan 时重新连接 Redis 的最大延迟。
upstream
nchan_redis_reconnect_delay_min
设置 Nchan 在发生故障时重试与 Redis 的连接前的最小延迟。
upstream
nchan_redis_retry_commands
`nchan_redis_retry_commands` 指令指定当发生故障时 Nchan 会重试向 Redis 服务器发送命令的次数。
upstream
nchan_redis_retry_commands_max_wait
指令 'nchan_redis_retry_commands_max_wait' 设置 Nchan 的 pub/sub 消息系统中重试 Redis…
upstream
nchan_redis_server
配置 NGINX 服务器,使其在 Nchan 模块中连接到 Redis 实例以进行消息缓冲。
upstream
nchan_redis_ssl
nchan_redis_ssl 指令在 Nchan 模块中为与 Redis 服务器的连接配置 SSL 选项。
upstream
nchan_redis_ssl_ciphers
为 Nchan 中的 Redis 连接设置 SSL 密码套件。
upstream
nchan_redis_ssl_client_certificate
指令 `nchan_redis_ssl_client_certificate` 指定在 Nchan 模块中用于 Redis 连接的 SSL 客户端证书。
upstream
nchan_redis_ssl_client_certificate_key
指令 `nchan_redis_ssl_client_certificate_key` 指定 Nchan 中用于 Redis 连接的 SSL…
upstream
nchan_redis_ssl_server_name
为 Nchan 使用的 Redis 连接设置 SSL 服务器名称。
upstream
nchan_redis_ssl_trusted_certificate
为 Nchan 的 pub/sub 配置中的 Redis 连接定义受信任的 SSL 证书。
upstream
nchan_redis_ssl_trusted_certificate_path
指定在连接到 Redis 时 Nchan 使用的受信任 SSL 证书的路径。
upstream
nchan_redis_ssl_verify_certificate
在 Nchan 的 pub/sub 服务器配置中,`nchan_redis_ssl_verify_certificate` 指令用于启用对 Redis…
upstream
nchan_redis_storage_mode
'nchan_redis_storage_mode' 指令配置 Nchan 与 Redis 集成时用于 pub/sub 操作的数据存储模式。
httpserverlocation
nchan_redis_subscribe_weights
'nchan_redis_subscribe_weights' 指令允许您在 NGINX 配置中为 Redis…
upstream
nchan_redis_tls
nchan_redis_tls 指令为 Nchan 模块中使用的 Redis 连接配置 TLS。
upstream
nchan_redis_tls_ciphers
'nchan_redis_tls_ciphers' 指令指定在 Nchan 中用于与 Redis 建立安全连接时允许的 TLS 密码套件列表。
upstream
nchan_redis_tls_client_certificate
`nchan_redis_tls_client_certificate` 指令指定在通过加密连接到 Redis 实例时使用的 TLS 客户端证书。
upstream
nchan_redis_tls_server_name
`nchan_redis_tls_server_name` 指令设置用于 Nchan 配置中与 Redis 服务器的 TLS 连接的服务器名称。
upstream
nchan_redis_tls_trusted_certificate
`nchan_redis_tls_trusted_certificate` 指令指定用于与 Redis 建立 TLS 连接的受信任 CA 证书。
upstream
nchan_redis_tls_trusted_certificate_path
指定用于与 Redis 建立安全连接的受信任 TLS 证书的路径。
upstream
nchan_redis_tls_verify_certificate
控制在 NCHan 中通过 TLS 与 Redis 通信时是否验证 SSL 证书。
upstream
nchan_redis_upstream_stats
指令 `nchan_redis_upstream_stats` 配置用于 Nchan 模块的上游 Redis 连接的统计报告。
serverlocation
nchan_redis_upstream_stats_disconnected_timeout
以秒为单位设置断开连接的 Nchan Redis 上游服务器的超时时间。
upstream
nchan_redis_upstream_stats_enabled
启用 Nchan 模块中用于 Redis 上游的统计收集。
upstream
nchan_redis_url
nchan_redis_url 指令为 Nchan 的 pub/sub 消息存储配置 Redis 服务器的 URL。
httpserverlocation
nchan_redis_username
`nchan_redis_username` 指令指定用于对 Nchan 在 pub/sub 操作中使用的 Redis 服务器进行身份验证的用户名。
upstream
nchan_redis_wait_after_connecting
配置在连接到 Redis 后,Nchan pub/sub 架构中的等待时间。
httpserverlocation
nchan_shared_memory_size
`nchan_shared_memory_size` 指令配置为 Nchan 的消息存储分配的共享内存大小。
http
nchan_storage_engine
`nchan_storage_engine` 指令指定用于 Nchan pub/sub 服务器的存储后端,允许配置消息缓冲策略。
httpserverlocation
nchan_store_messages
`nchan_store_messages` 指令启用对发送到通道的消息进行存储,以便订阅者稍后检索。
httpserverlocation
nchan_stub_status
nchan_stub_status 指令提供了一种通过 HTTP 端点公开 Nchan 的 pub/sub 系统状态指标的方法。
location
nchan_sub_channel_id
指令 `nchan_sub_channel_id` 在 Nchan 发布/订阅模块中定义了订阅者的频道标识符。
serverlocationif in location
nchan_subscribe_existing_channels_only
指令 `nchan_subscribe_existing_channels_only` 限制订阅者只能连接已存在的频道,防止在订阅期间创建新频道。
httpserverlocation
nchan_subscribe_request
指令 `nchan_subscribe_request` 指定了如何在 Nchan 模块中处理对 pub/sub 频道的订阅请求。
serverlocationif in location
nchan_subscriber
`nchan_subscriber` 指令为 Nchan 订阅者指定频道 ID。
serverlocationif in location
nchan_subscriber_channel_id
指令 `nchan_subscriber_channel_id` 在 Nchan 模块中配置订阅者的通道标识符。
serverlocationif in location
nchan_subscriber_compound_etag_message_id
`nchan_subscriber_compound_etag_message_id` 指令用于在 Nchan 的发布/订阅 (pub/sub)…
serverlocationif in location
nchan_subscriber_first_message
指令 `nchan_subscriber_first_message` 通过决定订阅者在订阅时是否应接收频道中已发布的第一条消息来配置订阅者的行为。
serverlocationif in location
nchan_subscriber_http_raw_stream_separator
`nchan_subscriber_http_raw_stream_separator` 指令在 Nchan 的 pub/sub 模块中为原始 HTTP…
serverlocationif in location
nchan_subscriber_info
在 Nchan(一款用于 NGINX 的发布/订阅 (pub/sub) 服务器)中,`nchan_subscriber_info`…
location
nchan_subscriber_info_string
指令 `nchan_subscriber_info_string` 配置一个自定义字符串,以在发布/订阅 交互期间随订阅者信息一并发送。
serverlocation
nchan_subscriber_last_message_id
nchan_subscriber_last_message_id 指令允许 Nchan 订阅者指定他们收到的最后一条消息的…
serverlocationif in location
nchan_subscriber_location
nchan_subscriber_location 指令为 Nchan 模块定义了一个用于处理订阅请求的 location 块。
serverlocationif in location
nchan_subscriber_message_id_custom_etag_header
为 NGINX 的 Nchan 模块中的订阅者消息定义自定义 ETag 头。
serverlocationif in location
nchan_subscriber_timeout
nchan_subscriber_timeout 指令设置了订阅者在服务器关闭连接之前允许空闲的最长时间。
httpserverlocation
nchan_unsubscribe_request
`nchan_unsubscribe_request` 指令指定了在 Nchan 的 pub/sub 模型中取消订阅频道时的请求处理方式。
serverlocationif in location
nchan_use_redis
`nchan_use_redis` 指令启用在 Nchan 模块中使用 Redis 作为消息缓冲的存储后端。
httpserverlocation
nchan_websocket_client_heartbeat
nchan_websocket_client_heartbeat 指令定义了通过 WebSocket 连接发送心跳消息以保持会话活动的间隔。
serverlocationif in location
nchan_websocket_ping_interval
'nchan_websocket_ping_interval' 指令指定向 WebSocket 连接发送 ping 消息以保持其存活的时间间隔。
serverlocationif in location
push_authorized_channels_only
指令 `push_authorized_channels_only` 限制订阅者只能接收其有权限访问的频道中的消息。
httpserverlocation
push_channel_group
指令 `push_channel_group` 定义了一个命名组,用于在 NGINX 的 pub/sub 架构中管理多个推送通道。
serverlocationif in location
push_channel_timeout
`push_channel_timeout` 指令设置推送通知通道在无活动情况下保持打开直至超时的最长持续时间。
httpserverlocation
push_max_channel_id_length
`push_max_channel_id_length` 指令设置了 Nchan pub/sub 操作中频道 ID 的最大允许长度。
httpserverlocation
push_max_channel_subscribers
限制 Nchan pub/sub 配置中频道的最大订阅者数量。
httpserverlocation
push_max_message_buffer_length
指令 `push_max_message_buffer_length` 用于设置 Nchan 模块中消息的最大缓冲长度。
httpserverlocation
push_max_reserved_memory
指令 `push_max_reserved_memory` 在 Nchan 中设置为推送通知保留的最大内存量。
http
push_message_buffer_length
设置每个 pub/sub 通道可缓冲的最大消息数。
httpserverlocation
push_message_timeout
`push_message_timeout` 指令配置了消息在超时以前为订阅者保留的最长时长。
httpserverlocation
push_min_message_buffer_length
设置 Nchan 的 pub/sub 实现中消息的最小缓冲长度。
serverlocationif in location
push_publisher
该 `push_publisher` 指令配置一个 location 来处理 HTTP 请求,用于在 Nchan 模块中将消息发布到指定频道。
serverlocationif in location
push_store_messages
`push_store_messages` 指令用于配置 Nchan 模块中发布到频道的消息的存储行为。
httpserverlocation
push_subscriber
`push_subscriber` 指令在 Nchan 模块中配置用于订阅推送消息的 location 块。
serverlocationif in location
push_subscriber_concurrency
`push_subscriber_concurrency` 指令限制 NGINX Nchan 模块中每个通道的并发推送订阅者数量。
serverlocationif in location
push_subscriber_timeout
在 NGINX Nchan 中,`push_subscriber_timeout` 指令设置订阅者连接允许的最大空闲时间。
httpserverlocation