r - 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;
}
}
解决方案
推荐阅读
- php - 几个文件中的变量传输 PHP 与 mysql
- java - 如何在反应器中获取先前传递的变量?
- outlook-addin - Outlook AddIn Mobile 问题 - 无法在移动设备中运行,而相同的代码适用于桌面和 Web 客户端
- javascript - 无法访问传递给组件 React 的对象
- postgresql - Postgresql:错误:“DO”处或附近的语法错误
- sql - SQL 中的逐行处理
- python - 使用python上传wav文件并保存在目录中
- c - 原始 TCP 套接字在发送初始数据后接收常量 PSH、ACK 数据包
- excel - 如何以某种格式在excel中打印今天的日期
- regex - Ansible lineinfile - apache 虚拟主机块