更新闪亮的服务器配置以更改超时错误

Updating Shiny Server Config to change timeout error

我有一个闪亮的应用程序,内置 downloadHandler,它适用于较小的数据集,但当文件变大 (330 MB) 时,它会超时,我会收到错误消息。

我发现了这个 SO 问题 (shiny downloadHandler timeout),虽然我不知道如何更新配置文件以考虑 http_keepalive_timeout.

,但它似乎解决了答案

下面是我的配置文件:

# 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;

  }
}

使用这个 SO 答案修复了它

我把 http_keepalive_timeout 函数放错了地方。请参阅下面的正确 shiny-server.conf 更新:

# 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;

  }
}