secure_token_content_type_m3u8
The `secure_token_content_type_m3u8` directive specifies the media types for which secure tokens should be generated for streaming content.
Description
The secure_token_content_type_m3u8 directive is used within the Secure Token module for NGINX to define the MIME types that are eligible for token-based authentication. This directive specifically applies to content types commonly associated with streaming media, particularly the .m3u8 playlist files, which are used in the HLS (HTTP Live Streaming) protocol. By including this directive in your NGINX configuration, you ensure that any request for media items of these types will be processed to include a secure token, making the resources accessible only to authorized clients.
When configured correctly, the secure_token_content_type_m3u8 directive acts as a control mechanism, determining which response types should incorporate security measures via token generation. The secure token itself is then appended to the Media playlist or returned with the requested resource as a cookie, providing flexibility in how clients authenticate their requests. If the media type matches the specified type, NGINX will generate a token that includes defined parameters such as expiration and access control lists (ACLs). This is particularly useful for secure streaming applications, ensuring that unauthorized access to the media stream is prevented.
The behavior of this directive can be influenced by other settings in NGINX and can extend to various contexts such as http, server, or location. For optimal results, it's also important to ensure that appropriate MIME types are defined in conjunction with this directive to avoid misconfigurations.
Config Example
secure_token_content_type_m3u8 application/vnd.apple.mpegurl;
Ensure the MIME type matches the expected format for HLS files.
Remember that this directive only controls token generation for the specified MIME types; any unsupported types will not receive tokens.