Status 500 for shiny apps JS libraries with port forwarding

I have shiny-server on my server hosting a few apps. I'm having trouble with status 500 for various files (usually javascript libraries), and it seems random which ones fail on any page load.

image

This happens when I've got port forwarding on; domain.com/shiny/app fails while 123.456.789:3838/app works. I'm assuming my issues are either with my nginx.conf or my shiny-server.conf. I have a my apps sitting in folders within the /srv/shiny-server/ folder.

Any advice would be much appreciated!

I've naively copied the nginx.conf from posts here in the http and server;

http { ...
map $http_upgrade $connection_upgrade {
		default upgrade;
		''	close;
	}
}
server{ ...
rewrite ^/shiny$ $scheme://$http_host/shiny/ permanent;
    
  location /shiny/ {
    rewrite ^/shiny/(.*)$ /$1 break;
    proxy_pass http://localhost:3838;
    proxy_redirect / $scheme://$http_host/shiny/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_read_timeout 20d;
    proxy_buffering off;
  }
}

the shiny-server.conf (again with some naïve copying)

server {
  listen 3838;

  # Define a location at the base URL
  location / {
  
  # Only up tp 20 connections per Shiny process and at most 3 Shiny processes
    # per application. Proactively spawn a new process when our processes reach 
    # 90% capacity.
    utilization_scheduler 20 .9 3;

    # 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;
	
	# if a user is idle for x seconds (no interaction with server),
    # disconnect them from the server
    app_session_timeout 900;

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

# My apps
  location /statdists {
    app_dir /srv/shiny-server/statdists;
    log_dir /var/log/shiny-server;
  }

   location /gnaf {
    app_dir /srv/shiny-server/gnaf;
    log_dir /var/log/shiny-gnaf;
  }
  
   location /poops {
    app_dir /srv/shiny-server/poops;
    log_dir /var/log/shiny-poops;
  }

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.