Poochinblack
Poochinblack

Reputation: 71

Host an app at home location of Shiny server

I installed my Shiny server and it is working fine with multiple app under this directory:

/srv/shiny-server/app1 /srv/shiny-server/app2

I can use www.mydomain.com/app1 to access my app.

But when I use www.mydomain.com it shows the default shiny server app with the example app.

All I want is when I go to www.mydomain.com I can see app1, how can I make that happen?

Thank you

Upvotes: 3

Views: 1939

Answers (2)

Hallie Swan
Hallie Swan

Reputation: 2774

As the other answer mentioned, you can edit the locationconstruct of /etc/shiny-server/shiny-server.conf.

Remove or comment out the site_dir and directory_index lines. Leave the log_dir line -- a log_dir is required within your first location construct. Add an app_dir line with the path to your app.

This works with the sample apps:

1) Remove the index.html file from /srv/shiny-server/

2) Edit the location section of /etc/shiny-server/shiny-server.conf to look like this:

location / {
    # Host app at base directory
    app_dir /srv/shiny-server/sample-apps/hello;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;
    }
}

Upvotes: 4

bwbioinfo
bwbioinfo

Reputation: 91

from: http://docs.rstudio.com/shiny-server/

modify your /etc/shiny-server/shiny-server.conf

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

Upvotes: 2

Related Questions