(I am not asking what happened here - I presume you were rebuilding the docker app or something, it doesn’t matter.)
My query is: How are you achieving a nice error page like this? When I rebuild the app, I just get “502 Bad Gateway / nginx”, something like
It would be very nice to have a better “site offline” message. Perhaps this isn’t the purview of Discourse (since if the app is being rebuilt, the webserver is offline, right?), but if any pointers would be appreciated.
We serve the “offline” and “site not found” pages out of haproxy, which runs in front of all our sites (and doesn’t get “rebuilt” in the same way a Discourse instance does). You could teach nginx a similar trick, with the error_page directive and specifying a custom (static) page to load whenever a 502 would otherwise be served.
How about an edit to the standard Discourse app, in which as soon as nginx is starting up, it serves a nicer “hang on a sec…the site may be under maintenance…try again in a moment” message, instead of the unintelligible (to the average user) “Bad Gateway 502” message.
Then after, say, 1 minute, the default 502 error can be served (in case there really is a bad gateway).
Not sure how to go about this though.
This fixes only the few seconds while Discourse is booting. Serving a nicer error page while Discourse is rebuilding already requires an outer nginx, which can also handle the error message while Discourse is booting (as I just found out).
I’m building a howto for this soon-ish – hang tight