hls_key_path
The 'hls_key_path' directive specifies the path for the encryption keys used in HLS streaming.
Description
The 'hls_key_path' directive is configured in the context of the RTMP application settings within NGINX's RTMP module. This directive is used to define the file path where the encryption keys for HLS (HTTP Live Streaming) segments are stored. When enabled, it provides a means to securely deliver media content by allowing key access along with HLS media playlist files.
The argument for this directive is a string that indicates the path to the key file or directory. This path should be accessible by the NGINX server during streaming operations. When a client plays HLS streams that require encryption, the server will use the specified path to find the key files necessary for decrypting the video segments. This key management is crucial to ensure the security and confidentiality of the streamed content.
An important aspect of the 'hls_key_path' directive is that it works in conjunction with other HLS-related directives within the RTMP module such as 'hls on' and 'hls_fragment'. Proper configuration ensures that clients can access the necessary keys without exposing sensitive information or compromising content security.
Config Example
application myapp {
live on;
hls on;
hls_key_path /etc/nginx/keys;
hls_fragment 3s;
}Ensure that the path specified exists and is accessible by the NGINX worker processes.
If using SSL, make sure the key path is configured correctly to avoid permission issues.
The key files should be served correctly; otherwise, clients may fail to play the HLS stream.