server

The `server` directive defines a server block within the SRT configuration for handling SRT connections.

Syntaxserver { ... }
Defaultnone
Context
Argumentsnone

Description

The server directive is a critical part of the NGINX SRT module, allowing users to define specific server configurations to handle Secure Reliable Transfer (SRT) connections. This directive sets up a server block where various attributes can be configured to manage how SRT connections behave, including the ports to listen on and proxying behavior towards other backend services. Within a server block, users can also define additional parameters such as error logging, flow control, and Maximum Segment Size (MSS).

By nesting directives within the server block, administrators can tailor the settings for different application needs. For example, specific options like listen, which can determine the address and port on which the server should accept incoming connections, can be set. The flow control and buffer sizes can also be adjusted to optimize performance based on the application's requirements. Each server block can work independently, means different services can utilize the same SRT instance with their distinct configurations, enhancing flexibility in handling diverse workloads.

The use of the SRT module facilitates bidirectional data transfer capabilities by seamlessly handling TCP and SRT requests, leveraging libsrt for SRT communication. This approach fosters reliable streaming of data in scenarios where network conditions are unpredictable, reaffirming the directive's utility in modern web applications that depend on stable and efficient data transmission.

Config Example

srt {
    server {
        listen 4321;
        proxy_pass tcp://127.0.0.1:5678;
    }
}

Ensure that the listen directive is correctly set up within the server block, as it specifies the incoming connection points.

Misconfiguring the proxy settings can lead to connection failures, so verify the backend endpoint configurations carefully.

Incorrectly managing the maximum segment size or buffer sizes can hinder performance, especially in high-load scenarios. Adjust these settings based on testing results.

← Back to all directives