R 是否可以使用NGINX将多个闪亮的应用部署到一台服务器?

R 是否可以使用NGINX将多个闪亮的应用部署到一台服务器?,r,nginx,shiny,shiny-server,R,Nginx,Shiny,Shiny Server,理想情况下,如果我有两个应用程序,我希望一台服务器能够同时为这两个应用程序提供服务 目前,我的配置文件支持在端口3838部署一个闪亮的应用程序 是否可以在另一个端口上运行另一个Shining server实例,以便我的一台服务器可以承载两个不同的应用程序 如果是这样的话,如果我试图完成这项任务,配置文件会是什么样子 提前感谢您您需要单独的服务器实例,还是需要为两个应用程序提供服务 在第一次安装Shining Server时,第一页将告诉您如何添加多个应用程序。您应该能够简单地将它们放在单独的文件

理想情况下,如果我有两个应用程序,我希望一台服务器能够同时为这两个应用程序提供服务

目前,我的配置文件支持在端口3838部署一个闪亮的应用程序

是否可以在另一个端口上运行另一个Shining server实例,以便我的一台服务器可以承载两个不同的应用程序

如果是这样的话,如果我试图完成这项任务,配置文件会是什么样子


提前感谢您

您需要单独的服务器实例,还是需要为两个应用程序提供服务

在第一次安装Shining Server时,第一页将告诉您如何添加多个应用程序。您应该能够简单地将它们放在单独的文件夹中,例如
/srv/shinny server/app1
。/app2

这也在位于2.2.2位置的中进行了说明

server {
  ...
  # Define the location '/specialApp'
  location /specialApp {
    # Run this location in 'app_dir' mode, which will host a single Shiny
    # Application available at '/srv/shiny-server/myApp'
    app_dir /srv/shiny-server/myApp
  }
  
  # Define the location '/otherApps'
  location /otherApps {
    # Run this location in 'site_dir' mode, which hosts the entire directory
    # tree at '/srv/shiny-server/apps'
    site_dir /srv/shiny-server/apps;
  }
...
}

如果我理解正确,您不需要另一台服务器,而是需要同一台服务器上的另一个应用程序

不要将侦听不同端口的两个应用程序
与只侦听一个端口的一台服务器和两个应用程序混淆,因为通常应该只有一台服务器,正如您所说,侦听端口3838将根据URL提供一个或另一个应用程序

如果您已经有一个
/etc/shinny server/shinny server.conf
文件,您应该只添加指令,以便服务器向一个应用程序而不是另一个应用程序发送请求

您应该使用以下规则编辑该文件:

server {
  ...
  # When accessing yourServer:3838/specialApp1
  location /specialApp1 {
    # Nginx will send the request to this application
    app_dir /srv/shiny-server/myApp
  }
  
  # When accessing yourServer:3838/specialApp2
  location /specialApp2 {
    # Nginx will send the request to this application
    app_dir /srv/shiny-server/myApp2
  }
...
}
希望有帮助!如果没有,请发布您的
/etc/shinny server/shinny server.conf
文件