Listed below are all the directives that are supported in Shiny Server config files.
Applies to indicates the kind of parent scope that this directive normally appears inside.
Inheritable means that you can put this directive at a higher level in the hierarchy and it will be inherited by any children to which it might apply. Inherited directives can be overridden by using the directive again in a child scope.
The user the app should be run as. This user should have the minimal amount of privileges necessary to successfully run the application (i.e. read-only access to the Shiny application directory). Note that this directive cannot be used with user_apps, as user_apps
always run as the user who owns the application.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
users | String | multiple | The username that should be used to run the app. If using home_dirs, this can also be the special keyword :HOME_USER: which will instruct home_dirs to run as the user in whose home directory the application exists. If using a special keyword like :HOME_USER: , you can specify additional usernames afterwards which will be used when this directive is applied to hosting models other than home_dirs . |
The file path of the HTTP access log.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
path | String | required | The file path where the access log should be written | |
format | String | optional | The log file format; see Connect documentation under "Formats" | default |
Top-level
Yes
Declares an HTTP server. You need one of these for each port/IP address combination this Shiny Server instance should listen on.
This directive has no parameters.
Top-level
Yes
listen
, server_name
Directs the enclosing server scope to listen on the specified port/IP address combination.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
port | Integer | required | Port to listen on | |
host | String | optional | IPv4 address to listen on (* or 0.0.0.0 for all); hostnames are not currently allowed, please use raw IPv4 address only |
* |
server
Yes
Directs the enclosing server scope to only honor requests that have the given host headers (i.e. virtual hosts).
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
names | String | multiple | The virtual hostname(s) to bind this server to |
server
Yes
Creates a scope that configures the given URL as a website (site_dir), specific application (app_dir), autouser root (user_apps), autouser root with run_as support (user_dirs), or redirect to a different URL (redirect).
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
path | String | required | The request path that this location should match |
server
, location
Yes
run_as
, location
, site_dir
, directory_index
, user_apps
, user_dirs
, app_dir
, redirect
, log_dir
, members_of
, google_analytics_id
, application
, template_dir
Configures the enclosing location scope to be a website that can contain both Shiny applications and unrelated static assets in a single directory tree.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
rootPath | String | required | The path to the root directory of the website |
location
Yes
When enabled, if a directory is requested by the client and an index.html
file is not present, a list of the directory contents is created automatically and returned to the client. If this directive is not present in a custom config file, the default behavior is to disable directory indexes. However, it is enabled if no config file is present at all (in other words, the default config file has it enabled).
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
enabled | Boolean | required | Whether directory contents should automatically displayed |
DEPRECATED! This directive has been deprecated in favor of user_dirs, which offers more flexibility with regards to the run_as configuration. Configures the enclosing location scope to be an autouser root, meaning that applications will be served up from users' ~/ShinyApps directories and all Shiny processes will run as the user in whose directory the application is found.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
enabled | Boolean | optional | Whether this location should serve up all users' ~/ShinyApps directories | true |
location
Yes
Configures the enclosing location scope to be an autouser root, meaning that applications will be served up from users' ~/ShinyApps directories. This directive does respect an affiliated run_as setting, meaning that the applications will be executed as whichever user is configured in the applicable run_as setting. Note that many distributions, by default, will prohibit users from being able to access each other's home directories.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
enabled | Boolean | optional | Whether this location should serve up all users' ~/ShinyApps directories | true |
location
Yes
Configures the enclosing location scope to serve up the specified Shiny application.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
path | String | required | The path to the Shiny application directory |
location
Yes
Configures the enclosing location to redirect all requests to the specified URL.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
url | String | required | The URL (or base URL) to redirect to | |
statusCode | Integer | optional | The status code to send with the response (usually 301 for permanent redirects or 302 for temporary redirects) | 302 |
exact | Boolean | optional | Whether to match on the URL exactly; if false, any subpaths will match as well | true |
location
Yes
Directs the application to write error logs to the specified directory. Only applies to location scopes that are configured with app_dir or site_dir, as user_apps (autouser) always writes error logs to ~/ShinyApps/log
.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
path | String | required | The path to which application log files should be written |
Restricts a user_apps or user_dirs (autouser) scope to require membership in one or more groups (or, if no arguments are passed, lifts group restrictions from a members_of directive in a parent scope).
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
groups | String | multiple | Users must be a member of at least one of these groups in order to deploy applications; if no groups are provided, then all users are allowed |
Configure Google Analytics tracking code to be inserted in Shiny application pages.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
gaid | String | required | The Google tracking ID, for example, UA-18988-1 |
Defines the amount of time Shiny Server will wait for an R process to start before giving up.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
timeout | Integer | required | The number of seconds to wait for the application to start. |
Top-level, server
, location
, application
Yes
Defines the amount of time an R process will persist with no connections before being terminated.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
timeout | Integer | required | The number of seconds to keep an empty R process alive before killing it. |
Top-level, server
, location
, application
Yes
A basic scheduler which will spawn one single-threaded R worker for each application. If no scheduler is specified, this is the default scheduler.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
maxRequests | Integer | optional | The maximum number of requests to assign to this scheduler before it should start returning rejecting incoming traffic using a '503 - Service Unavailable' message. Once this threshold is hit, users attempting to initialize a new session will receive 503 errors. | 100 |
Top-level, server
, location
, application
Yes
If present, will allow users to override the global defaults for a scheduler by customizing the parameters associated with a scheduler or even the type of scheduler used.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
enabled | Boolean | optional | Whether or not this is enabled. Default is true. | true |
Top-level
Yes
DEPRECATED. This setting is deprecated and no longer enforced in Shiny Server. It will be ignored.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
empty | String | required |
location
Yes
app_init_timeout
, app_idle_timeout
, simple_scheduler
A directory containing custom templates to be used when generating pages in Shiny Server.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
dir | String | required | The directory containing HTML templates. |
Disable WebSockets on connections to the server. Some networks will not reliably support WebSockets, so this setting can be used to force Shiny Server to fall back to another protocol to communicate with the server. This is equivalent to adding 'websocket' to disabled_protocols
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
val | Boolean | optional | Whether or not WebSockets should be disabled. | true |
Top-level
Yes
Disable some of the SockJS protocols used to establish a connection between your users and your server. Some network configurations cause problems with particular protocols; this option allows you to disable those.
Parameter | Data type | Type | Description | Default |
---|---|---|---|---|
names | String | multiple | The protocol(s) to disable. Available protocols are: 'websocket', 'xdr-streaming', 'xhr-streaming', 'iframe-eventsource', 'iframe-htmlfile', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling' |
Top-level
Yes