publish_notify

The `publish_notify` directive configures notifications to be sent when a new stream is published in the RTMP context.

Syntaxpublish_notify URL;
Defaultnone
Context
Arguments1

Description

The publish_notify directive in the NGINX RTMP module allows users to specify a URL to notify when a new stream is published. This is particularly useful for integrating streaming events with external systems or services, enabling actions like updating databases, triggering automated workflows, or broadcasting notifications to connected clients. The directive takes a single argument, which is the URL to notify whenever a stream is published.

When a new RTMP stream is published, the NGINX server will send an HTTP POST request to the specified URL. This request can carry information about the stream such as the stream name, application name, and other relevant metadata, allowing the receiving server to process the event appropriately. This can help in scenarios where real-time updates about the stream's lifecycle are essential, such as when serving a large number of users or interacting with content management systems that track live streams.

To use this directive effectively, it is important to ensure that the target URL is reachable and properly configured to accept and handle the incoming POST requests. Additionally, because notifications occur on each stream publish, the endpoint should be efficient in processing these requests to avoid bottlenecks in stream management.

Config Example

application myapp {
    live on;
    publish_notify http://example.com/notify;
}

Make sure the notify URL is reachable; if the request fails, it may not be retried.

Ensure proper handling of the incoming request at the notify URL to avoid performance issues.

Be aware of how many notifications your application will receive, as this can affect the server load.

← Back to all directives