An update: a proper fix for this is introduced in this PR https://github.com/OSC/ondemand/pull/18 and will be included in the 1.4 release of OnDemand.
If the test for the user’s home directory fails, instead of aborting the PUN startup process, we start the PUN with this NGINX rewrite directive for all requests to the dashboard:
rewrite ^/pun/sys/dashboard(/.*|$) /pun/custom_html/missing_home_directory.html;
Two new locations have been added to the PUN. One for loading a custom html, if it exists, from /etc/ood/config/pun/html/missing_home_directory.html, and the default page will be served from the nginx_stage root directory i.e. /opt/ood/nginx_stage/html/missing_home_directory.html.
Since these locations will always be accessible you can see the default error page by going directly to http://ondemand.host.edu/pun/html/missing_home_directory.html and the custom error page by going directly to http://ondemand.host.edu/pun/custom_html/missing_home_directory.html. If there is no custom error page it will serve up the default one of course.
An example of a custom error page has been provided at
/opt/ood/nginx_stage/html/missing_home_directory.html.example.pam_mkhomedir and can be copied to /etc/ood/config/pun/html/.
Since the location directives are always in the PUN, you can do this, edit the file, reload and test changes to it without having to restart the web server. Both custom and default error page NGINX locations set the Control-Cache header to no-store so that every reload or button click to restart the web server will avoid browser caching the page.
The default error page looks like this:
The example custom error page looks like this: