New Passenger App: App has not been initialized or does not exist

Hello,
I wrote a passenger app under Ruby for OOD to display some usage information specific to our cluster/site. It’s based on the OSC sample code

I set it up in a dev area of my account, made the code changes, tested everything was working and happy. I then copied the code over to /var/www/ood/apps/sys, updated my nav_bar YAML, restarted the PUN and it shows up correctly on the portal menu
image
When I click the Usage link from the menu bar, it opens a new tab as requested but gives me a App has not been initialized or does not exist warning:

If I click Initialize App, then it works fine. I only seem to have to do this once. Problem is, every one of my users gets the same warning the first time they go to that app, so I’m guessing there is some additional step I need to do to somewhere inside OOD to solve this so the app is pre-initialized or something.

Thanks!

Ok, looks like I need to create a .conf file in /var/lib/ondemand-nginx/config/apps/sys that matches my passenger app, similar to the dashboard.conf, myjobs.conf and shell.conf files.

I copied shell.conf to myapp.conf and changed it to:

location ~ ^/pun/sys/myapp(/.*|$) {
  error_page 404 @error_404;
  alias /var/www/ood/apps/sys/myapp/public$1;
  passenger_base_uri /pun/sys/myapp;
  passenger_app_root /var/www/ood/apps/sys/myapp;
  passenger_document_root /var/www/ood/apps/sys/usage/myapp;
  passenger_enabled on;

  passenger_app_env production;

  passenger_env_var HTTP_X_SENDFILE_TYPE X-Accel-Redirect;
  passenger_env_var HTTP_X_ACCEL_MAPPING "/=/sendfile";
  passenger_set_header X-Sendfile-Type "X-Accel-Redirect";
  passenger_set_header X-Accel-Mapping "/=/sendfile";
}

And after running update_ood_portal and restarting Apache it’s working without the initializtion prompt. Do I need to retain in myapp.conf:

  # Give apps the ability to download files from filesystem
  passenger_env_var HTTP_X_SENDFILE_TYPE X-Accel-Redirect;
  passenger_env_var HTTP_X_ACCEL_MAPPING "/=/sendfile";
  passenger_set_header X-Sendfile-Type "X-Accel-Redirect";
  passenger_set_header X-Accel-Mapping "/=/sendfile";

Since myapp isn’t trying to do any uploading of data (just reporting status/usage data in an HTML table to the user)?

Or is there another, recommended method for creating myapp.conf by putting something under /etc/odd?

Thanks!