R Shiny-Server Open Source Load Balancing with nginx

Viewed 435

I have installed shiny-server open source on my AWS Lightsail instance and I have been trying on some few apps as per orthodox methods and they all work seamlessly. As I am planning further to extend my user base, I might be facing a problem with shiny-server being single threaded.

So, I want to load balance my shiny-server apps using NGINX as a load balancer, I know that this is possible to do but I haven't been able to find a proper tutorial or any solution on the web that helps figuring out how to manage this.

Could Anyone please help me out in understanding how to configure my NGINX configurations to support load balancing in shiny server. Any solutions that involve using Docker may also be appretiated.

Thanks a lot.

The R-shiny apps are hosted in the directory

/srv/shiny-server/

My NGINX configuration file for shiny server looks like the usual ones as shown below.

Server config


# 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;
  }
}
0 Answers
Related