Serving Rmd files from a subdirectory

This isn't a question so much as a comment about serving Rmd documents from a subdirectory from the server. This is related to issues I opened three months ago for which I never got a response. I finally got an answer to the question.

The first issue is what the config file should look like. This should be something like:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

# 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 /www1/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;

    ## RGA want to run as apache not root
    run_as shiny;

    location /IntroStats {
      site_dir /www1/shiny-server/IntroStats;

    location /Bayesian {
      site_dir /www1/shiny-server/IntroStats;


The second is that there should not be any Rmd files in the top level directory.

This later leads to some strange issues related to the file shared/shiny.min.js and similar files not being found. I don't think this is documented anywhere, so I wanted to put it down here.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.