✅ Shiny App & Document Deployment Checklist

1. Local Directory Structure

Ensure your local project folder looks like this:

project_root/
├── _site/                        # Quarto-rendered website
├── data_analyses/
│   ├── mtcars/
│   │   └── app_mtcars.R
│   └── sample_shiny_doc/
│       ├── sample_shiny_doc.Rmd
│       └── sample_shiny_doc.html

2. Remote Directory Layout After Deploy

Files should be uploaded to:

  • /var/www/danmailman.net/ ← For the Quarto site
  • /srv/shiny-server/mtcars/ ← For the mtcars app
  • /srv/shiny-server/sample_shiny_doc/ ← For the rendered shiny doc

3. Deployment Script Behavior

The script: - Copies _site/ to /var/www/danmailman.net/ - Scans data_analyses/ for: - Shiny app files matching app_*.R → copies them - Supporting files with extensions: .csv, .Rds, .RDS, .tsv, .json, .txt, .md - Uploads everything into matching subdirectories in /srv/shiny-server/

4. Nginx Configuration

Make sure /etc/nginx/conf.d/danmailman.net.conf includes:

location ^~ /data_analyses/ {
    proxy_pass http://127.0.0.1:3838/data_analyses/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_redirect off;
    proxy_read_timeout 20d;
    proxy_buffering off;

    # Allow Shiny Doc JS execution
    add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; object-src 'none';";
}

5. Testing

Visit in browser: - App: https://danmailman.net/data_analyses/mtcars/ - Doc: https://danmailman.net/data_analyses/sample_shiny_doc/sample_shiny_doc.html

Also test raw port for troubleshooting: - App: http://<your-ip>:3838/data_analyses/mtcars/ - Doc: http://<your-ip>:3838/data_analyses/sample_shiny_doc/sample_shiny_doc.html