首页 > 解决方案 > R Shiny-Server 开源负载平衡与 nginx

问题描述

我已经在我的 AWS Lightsail 实例上安装了 Shiny-server 开源,并且我一直在按照正统方法尝试一些应用程序,它们都可以无缝运行。当我计划进一步扩展我的用户群时,我可能会面临闪亮服务器是单线程的问题。

因此,我想使用 NGINX 作为负载平衡器来平衡我的闪亮服务器应用程序,我知道这是可能的,但我无法在网上找到合适的教程或任何解决方案来帮助弄清楚如何管理这个。

任何人都可以帮助我了解如何配置我的 NGINX 配置以支持闪亮服务器中的负载平衡。任何涉及使用 Docker 的解决方案也可能会受到欢迎。

非常感谢。

R-shiny 应用程序托管在目录中

/srv/闪亮服务器/

我的闪亮服务器的 NGINX 配置文件如下所示。

服务器配置


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

标签: rnginxshinyload-balancingshiny-server

解决方案


推荐阅读