Updating Shiny Server Config to change timeout err

2019-08-15 17:59发布

I have a shiny app with a downloadHandler built in and it works great for smaller datasets but when the file gets large (330 MB), it times out and I get an error.

I found this SO question (shiny downloadHandler timeout) which seems to address the answer although I don't know how to update the config file to take into account http_keepalive_timeout.

Below is my config file:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;


# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;

  }
}

1条回答
孤傲高冷的网名
2楼-- · 2019-08-15 18:51

Fixed it using this SO answer User session is getting interrupted after approx. 45 seconds

I was putting the http_keepalive_timeout function in the wrong place. Please see below for the correct shiny-server.conf update:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
http_keepalive_timeout 180;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;

  }
}
查看更多
登录 后发表回答