Main Content

files-root

Serve static content over HTTP or HTTPS

Syntax

--files-root path

Description

--files-root path enables MATLAB® Production Server™ to serve static content over HTTP or HTTPS.

To access static file content from a web browser, provide the file name file_name.ext (where ext is the file extension), host name server_host_name, and port server_port in the format http(s):server_host_name:server_port/~files/file_name.ext.

Parameters

path

Path to the folder containing static files.

Examples

  • For on-premises server instances created using the command line, update this server configuration property in the main_config server configuration file.

  • For on-premises server instances created using the dashboard and for server deployments in the cloud, use the dashboard and cloud dashboard, respectively, to update the server configuration property.

Serve Static Content

Assume that you have a server running at the host name my.server.com and port number 9910.

Configure Using Command Line
  1. Assume that you have a text file, my_file.txt, stored in a folder called static_files, and static_files is located in the root folder of your server instance.

  2. In the main_config server configuration file, specify the path to the static_files folder as the parameter to the files-root property.

    --files-root ./static_files

Configure Using Dashboard
  1. Assume that you have a text file, my_file.txt, stored in a folder called static_files, and static_files is located in the C:\tmp folder.

  2. In the dashboard, in the Settings tab of your server instance, under Advanced, enter the following for the Additional Options property.

    --files-root C:\tmp\static_files

To access my_file.txt from a web browser, specify the following in the address bar of your browser, http:my.server.com:9910/~files/my_file.txt.