Take down site during maintenance

(Ankhamax) #1

Is there anyway that we can take down site during maintenance from the admin section?

(Régis Hanol) #2

What do you mean by “take down”?

(Jay Pfaffman) #3

Do you mean have the site display a “We are upgrading. Please come back later.” message rather than return an error?

(Ankhamax) #4

@pfaffman Thank you. That’s exactly what I was looking for.

(Régis Hanol) #5

Then you will need a web server in front of Discourse to handle these requests and show up whatever maintenance message you want.

(Jeff Atwood) #6

I do wish our default Discourse cloud install handled the rebuild downtime a bit better, perhaps with some kind of nginx message about “site upgrading, please stand by for 5-10 minutes” but it’s low priority.

(Régis Hanol) #7

Then we’ll need to move nginx out of the container or make the 2 containers install the default one.

(Jeff Atwood) #8

Yeah it might not be an easy change, which is why it’s low-pri…

(Felix Freiberger) #9

Maybe a howto can lower the pain in the meantime? I did set up an outer nginx as described here, and added a tiny bit of configuration:

location /errorpages/ {
    alias /var/www/errorpages/; # place discourse_offline.html here

location / {
    error_page 502 = /errorpages/discourse_offline.html;
    # ... the usual stuff

This handles the main part of the downtime, although the inner nginx still provides its ugly error page while Discourse is starting, before rails is ready. Fortunately, that’s only a few seconds :wink:

Under Construction Page during Maintenance?
Links aren't showing in the sidebar or topic summaries on subfolder installs
Links aren't showing in the sidebar or topic summaries on subfolder installs
(Ankhamax) #10

How do I upload discourse_offline.html there?

(Felix Freiberger) #11

Create that folder (or any other folder) on your server, and either write the file directly on the server, or upload it to your server as usual (probably via SFTP).