What are the differences between webservers?

Apache

As the maturest and most flexible of available webservers, functionality is first developed for Apache. In some cases functionality can be ported to other webservers, in other cases not - e.g missing support for chunked transfer encoding in Lighttpd means that Live ingest is not supported in Lighttpd.

The following sections document these differences as well as outlining what can be ported, focusing on Apache and Nginx.

Configuration

The list of available Apache Options (keywords to be used in the virtual host configuration file) is the following:

Configuration key Description
UspLicenseKey The USP license key, the default is to place this in /etc/usp-license.conf.
UspHandleIsm Set to 'on' to enable mod_smooth_streaming functionality.
UspHandleF4f Set to 'on' to enable mod_f4fhttp functionality.
IsmProxyPass Pass .ism to proxy (a virtual path and URL).
UspIssPassThrough Set to 'on' to pass through MP4 fragments directly to Smooth Streaming.
UspPreferStatic Set to 'on' to prefer static files over dynamically generated files.
UspEnableMMAP Set to 'off' to disable use of memory-mapping.
UspSkipRewrite Set to 'on' to skip the internal rewrite rules.
S3SecretKey The AWS secret key.
S3AccessKey The AWS access key.

Further, in Apache it's possible to have Custom HTTP Status codes (Apache):

Configuration key Description
Fmp4IssFragmentNotFound The HTTP status code returned when the requested fragment is less than the first fragment available in the DVR window. (Default 404)
Fmp4IssFragmentMissing The HTTP status code returned when the requested fragment number is missing from the DVR window. (Default 412)
Fmp4IssFragmentNotAvailable The HTTP status code returned when the fragment number is larger than the last fragment available in the DVR window. (Default 412)

Apache only funtionality

The following functionality is available only in Apache:

The cause for this is how Apache structures resource management (RAM, file access etc).

Nginx

Live

Since 1.3.9 (November 2012) Nginx has support for chunked transfer encoding, so Live ingest (and encoder POSTing chunks) becomes possible. However, Nginx has added chunked transfer encoding in a rather limited way: the ability to POST a file, which is then written to disk as file.

Note

TODO outline the input filter use

Configuration

To make Nginx Apache's equal in terms of configuration the following configuration keys have to be added to the Nginx plugin:

Option Description
usp_license_key The USP license key, the default is to place this in /etc/usp-license.conf.
usp_handle_ism Enables mod_smooth_streaming functionality.
ism_proxy_pass Pass .ism to proxy (a virtual path and URL).
usp_handle_f4f Add to enable mod_f4fhttp functionality
usp_disable_mmap Add to disable use of memory mapped I/O.
s3_secret_key The AWS secret key.
s3_access_key The AWS access key.

The status code mapping can be done with Lua in Nginx:

header_filter_by_lua "
    FMP4_FRAGMENT_MISSING = 404
    if ngx.status == FMP4_FRAGMENT_MISSING then
        ngx.status = 204
    end
";

The S3 authentication can also be done by Authentication Header where the header looks like the following:

Authorization: AWS AWSAccessKeyId:Signature

This header can be generated in a location by for instance an nginx module [1], lua [2] or nginx variables and functions [3].

In general, an authorization header can be generated this way and passed upstream, the Hitachi content platform uses a similar authorization header.

Footnotes

[1]https://github.com/jamesmarlowe/lua-resty-s3#generate_auth_headers
[2]https://github.com/anomalizer/ngx_aws_auth
[3]https://dodwell.us/using-nginx-to-proxy-private-amazon-s3-web-services/

Unavailable functionality

Due to how Nginx is structured internally, the following functionality is not available on Nginx:

  • Progressive download
  • Download to own

The use of ism_proxy_pass is limited in the sense that the reference may not be to Nginx itself. For backround on this see What is the preferred webserver for media delivery?.

Lighttpd

For Lighttpd none of the options as listed for Apache are available.

Further, the following functionality is not available:

  • progressive download
  • download to own
  • live ingest

IIS 5/6/7/8

For IIS none of the options as listed for Apache are available.

Further, the following functionality is not available:

  • progressive download
  • download to own
  • live ingest (IIS 7/8)

Webserver Overview

The following table provides an overview of features available or not due to webserver internals:

Webserver Progressive Download Download to Own Live ingest
Apache y y y
Nginx n n y
Lighttpd n n n
IIS n n n