...
When configuring the EchoSystemServer for use with an external web server for content playback (see Using an External Web Server for Content Playback), downloadable static media, such as .MP3 and .M4V files , are still served through the built-in Jetty web server. In deployments that experience regular high load, having these files served through Jetty can have a serious impact on application performance. The following document covers how to offload the serving of these files to an external web server that has previously been configured for ESS content playback.
...
...
Consult your web server software configuration guide for further details on enabling URL rewrite capability, or contact Echo360 Technical Support for guidance.
Configuring an IIS Web Server
...
- On the left panel, expand your domain (or computer name) in the list.
- Expand the Sites option, then click on Default Web Site.
- On the Features View tab, double-click on URL Rewrite.
- In the Actions panel on the right side of the screen, click on Add Rule(s)...
- In the window that appears, under the Outbound Rules section select Blank rule and then the OK button. You will then be presented with the page to create a new outbound rule.
- Set the name of the rule to "Allow Podcast Download" (without the quotations).
Use the drop-down to select <Create New Precondition...> and populate the following values for the new Precondition:
Field Value Name Only Match Podcast Using Regular Expressions
Logical Group Match All Click the Add.. button to add a new condition, and populate the following values:
Field Value Condition Input {RESPONSE_CONTENT_TYPE} Check if input string Matches the Pattern
Pattern ^audio/mpeg Ignore case Checked - Press OK to complete adding the condition.
Press OK to complete adding the precondition.
Expand the Match section, and populate the following values:
Field Value Matching Scope Server Variable Variable Name RESPONSE_Content_Disposition Variable Value Matches the Pattern Using Regular Expressions Pattern (.*) Ignore Case Checked Expand the Conditions section.
- Set the Logical grouping to Match All.
- Ensure the Track capture groups across conditions option at the bottom of the pane is checked.
Click on the Add... button. A window will appear to add a new condition. Populate the following values:
Field Value Condition Input {QUERY_STRING} Check if input string Matches the Pattern
Pattern ^download Ignore case Checked - Press OK to complete adding the condition.
Expand the Actions section and populate the following values:
Field Value Action Type Rewrite Value attachment;filename=media.mp3
Replace existing server variable value Checked Stop processing on subsequent rules Unchecked - In the Action panel on the right side of the screen, click on Apply. If successful, you'll see the message: "The changes have been successfully saved."
- Click the Back to Rules link.
- Click on Add Rule(s)... again to add another rule.
- Set the name of the rule to "Allow Vodcast Download" (without the quotations).
Use the drop-down to select <Create New Precondition...> and populate the following values for the new Precondition:
Field Value Name Only Match Vodcast Using Regular Expressions
Logical Group Match All Click the Add.. button to add a new condition, and populate the following values:
Field Value Condition Input {RESPONSE_CONTENT_TYPE} Check if input string Matches the Pattern
Pattern ^video/m4v Ignore case Checked Note title Note for IIS 8.5 Though not supported at this time, if you are using IIS 8.5 the match pattern should be set to "^video/mp4" rather than "^video/m4v".
- Press OK to complete adding the condition.
Press OK to complete adding the precondition.
Expand the Match section, and populate the following values:
Field Value Matching Scope Server Variable Variable Name RESPONSE_Content_Disposition Variable Value Matches the Pattern Using Regular Expressions Pattern (.*) Ignore Case Checked Expand the Conditions section.
- Set the Logical grouping to Match All.
- Ensure the Track capture groups across conditions option at the bottom of the pane is checked.
Click on the Add... button. A window will appear to add a new condition. Populate the following values:
Field Value Condition Input {QUERY_STRING} Check if input string Matches the Pattern
Pattern ^download Ignore case Checked - Press OK to complete adding the condition.
Expand the Actions section and populate the following values:
Field Value Action Type Rewrite Value attachment;filename=media.m4v
Replace existing server variable value Checked Stop processing on subsequent rules Unchecked - In the Action panel on the right side of the screen, click on Apply. If successful, you'll see the message: "The changes have been successfully saved."
- Click the Back to Rules link.
- The two new outbound rules should be shown in the bottom panel.
- Restart the IIS service for these changes to take effect, and proceed to the section below below Enabling External Media Downloads on the ESS.
Configuring an Apache Web Server
These instructions assume that you have already installed the appropriate Apache web server packages , and have service already configured for use with ESS content playback. You will also need to have the mod_rewrite and mod_header Apache modules installed. Refer to the Apache or system documentation for instructions on how to do this for your platform.
...
Make a backup copy of your configuration file before proceeding. By default, the configuration file is named default.conf and placed in the directory /etc/nginx/conf.d
Add the following directives to the location block referencing the URL alias for your ESS content (e.g.,
location /echocontent
):
Code Block if ($query_string ~* ^download) { set $target $1; add_header Content-Disposition 'attachment; filename="$target"'; }
This should result in a stanza similar to this:
Code Block location /echocontent { alias /usr/share/nginx/echocontent; if ($query_string ~* ^download) { set $target $1; add_header Content-Disposition 'attachment; filename="$target"'; } }
In this example,
/usr/share/nginx/echocontent
is the location of the mount point created for the active content directory. Your Your configuration will vary.
Restart the NGINX service for the changes to take effect, and proceed to the section below below Enabling External Media Downloads on the ESS.
...