flv

The 'flv' directive enables or disables the handling of FLV video files for streaming in NGINX.

Syntaxflv;
Defaultoff
Contextlocation
Argumentsnone

Description

The flv directive is used within the NGINX configuration in the context of a location block to specify whether to process FLV (Flash Video) files when serving content. When enabled, NGINX will configure itself to properly handle requests for FLV files, allowing for streaming of videos with correct headers and behaviors expected by FLV players. This directive does not take any arguments; simply including it will enable the FLV processing feature within that context. The implementation in the NGINX source code ensures that specific response headers and buffering rules are applied to FLV files to facilitate smooth streaming experiences.

The directive can be placed within a location block where you want to serve FLV content. If it is used in a server block without a specific location, the directive will be ignored unless there are explicitly defined locations for FLV files. When serving files with the correct MIME type, using the flv directive ensures NGINX handles requests appropriately and can optimize for better streaming performance. It's important to note that this directive is largely deprecated as use of Flash has diminished significantly, and modern alternatives are preferred for video streaming.

Config Example

location /videos {
    flv;
    root /var/www/videos;
}

Ensure you are correctly serving .flv files with the right MIME type; otherwise, the stream may not play correctly.

Check that the location block is properly defined to ensure this directive takes effect.

← Back to all directives