# Add an offline page to display when Discourse is rebuilding or starting up

**URL:** https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238
**Category:** Sysadmins
**Tags:** configuring, how-to, advanced-setup
**Created:** [6월 4, 2016, 8:41오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238 "2016-06-04T08:41:48Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![ewanly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ewanly/32/62854_2.png) [@ewanly](https://meta.discourse.org/u/ewanly)
#### Post date: [10월 20, 2016, 11:18오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/41 "2016-10-20T11:18:41Z")

</div>

I’m running Ubuntu 14.04, do you think that Nginx we installed here is supporting `http2` ?  
Could be this change a help to show the offline page while rebuilding?

PS: Sorry I hadn’t a chance too look at the logs at /var/log/nginx/ as you’d asked. As you may saw I’m facing some other serious problems ☹ soon I look at it and will come back to you.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [10월 20, 2016, 11:21오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/42 "2016-10-20T11:21:45Z")

</div>

> [@ewanly](#):
>
> I’m running Ubuntu 14.04, do you think that Nginx we installed here is supporting http2 ?

I’m not sure – and I don’t think I have a 14.04 instance lying around to test. But you can easily try it: Add `http2` to the `listen` block, und `service reload nginx`. If it errors out, it isn’t supported 🙂

---

<div class="post-metadata">

### Author: ![ewanly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ewanly/32/62854_2.png) [@ewanly](https://meta.discourse.org/u/ewanly)
#### Post date: [10월 23, 2016, 9:28오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/43 "2016-10-23T09:28:23Z")

</div>

You were right. I had one mistakes in Nginx config. I just fixed it and now the offline page working like charm. Thank you a lot 🍾

---

<div class="post-metadata">

### Author: ![ewanly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ewanly/32/62854_2.png) [@ewanly](https://meta.discourse.org/u/ewanly)
#### Post date: [10월 23, 2016, 9:37오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/44 "2016-10-23T09:37:58Z")

</div>

> [@fefrei](#):
>
> I’ve updated the initial post to also recommend enabling http2 in the nginx configuration.

For Info: I just had a chance to try it with my 14.04 Ubuntu. It’s not supported. Nginx failed to reload.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12월 24, 2016, 7:56오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/45 "2016-12-24T19:56:44Z")

</div>

Hmm, wait, @sam complained this turns off http2. But, I upgraded to Ubuntu 16.04 and then changed this line:

`listen 443 ssl; listen [::]:443 ssl;`

to

`listen 443 ssl http2; listen [::]:443 ssl http2;`

And it seems to pass http/2 through fine now?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 24, 2016, 7:59오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/46 "2016-12-24T19:59:06Z")

</div>

Yeah, on 16.04 nginx can do http2.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [12월 26, 2016, 3:12오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/47 "2016-12-26T15:12:05Z")

</div>

I’ve slightly worded down the warning in the initial post to reflect this. Thanks for confirming, @codinghorror and @Falco!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1월 10, 2017, 11:23오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/48 "2017-01-10T11:23:41Z")

</div>

6 posts were split to a new topic: [Let’s Encrypt won’t renew with offline page](https://meta.discourse.org/t/lets-encrypt-wont-renew-with-offline-page/55473)

---

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [3월 7, 2017, 9:42오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/49 "2017-03-07T09:42:48Z")

</div>

> [@fefrei](#):
>
> add\_header X-Frame-Options DENY;

Can you clarify the purpose of adding this header here? It seems it has [conflict with embedding comments](https://meta.discourse.org/t/discourse-embedding-still-has-some-bugs/58530).

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [3월 7, 2017, 9:50오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/50 "2017-03-07T09:50:52Z")

</div>

No sense at all, at least now, since Discourse returns its own header. I’ll remove it from the howto. Thanks for reporting this!

---

<div class="post-metadata">

### Author: ![RoldanLT](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RoldanLT](https://meta.discourse.org/u/RoldanLT)
#### Post date: [6월 5, 2017, 2:21오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/51 "2017-06-05T02:21:55Z")

</div>

Hi, with the recent version of discourse is this still needed?  
Any downside/disadvantage of using this approach?

Why not modify directly the Nginx built in/default with discourse/docker to specify error pages?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [6월 5, 2017, 2:46오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/52 "2017-06-05T02:46:22Z")

</div>

> [@RoldanLT](#):
>
> Why not modify directly the Nginx built in/default with discourse/docker to specify error pages?

Because the container needs to running in order to serve pages, and the point of this configuration is to serve an error page when the Discourse app container _isn’t_ running.

---

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [7월 25, 2017, 10:01오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/53 "2017-07-25T10:01:51Z")

</div>

> [@fefrei](#):
>
> ssl\_ciphers ‘ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256’;  
> ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;

When you define the `ssl_ciphers` in nginx like what is proposed here, then your instance doesn’t support `TLSv1` and `TLSv1.1` anymore. Or at least not in my situation.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [7월 25, 2017, 10:04오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/54 "2017-07-25T10:04:39Z")

</div>

True that, so you could simplify the configuration by removing the outdated protocols. I’ll do that, thanks!

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [11월 13, 2017, 4:55오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/55 "2017-11-13T16:55:41Z")

</div>

> [@fefrei](#):
>
> proxy\_pass [http://unix](http://unix):/var/discourse/shared/standalone/nginx.http.sock:;

I had a Question!!

will using https:// instead of http:// in the above url break or else create any complication into the setup?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [11월 13, 2017, 5:00오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/56 "2017-11-13T17:00:22Z")

</div>

Why would you want to do that? This traffic never touches the network, there is no reason for HTTPS here.  
In this setup, HTTPS is provided entirely by the outer Nginx instance 🙂

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [11월 13, 2017, 5:05오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/57 "2017-11-13T17:05:16Z")

</div>

> [@fefrei](#):
>
> Why would you want to do that? This traffic never touches the network, there is no reason for HTTPS here.
> 
> In this setup, HTTPS is provided entirely by the outer Nginx instance 🙂

I asked that because in such a case with wordpress, using a https proxy for a http site will mess up a lot of thing even if one has got site working on both if the url is left http then there are a lot of content warnings at times so I was just curious to know.

anyway thanks for clarification.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [11월 13, 2017, 5:08오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/58 "2017-11-13T17:08:05Z")

</div>

This is taken care of by the headers set by Nginx, especially `X-Forwarded-Proto`: It tells Discourse that the user-facing protocol is HTTPS 🙂

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [11월 13, 2017, 5:10오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/59 "2017-11-13T17:10:46Z")

</div>

So necessarily it won’t matter if http or https is used in this configuration? right?

Ps: sorry for a noob question, I don’t really know much about http headers

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [11월 13, 2017, 5:12오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/60 "2017-11-13T17:12:01Z")

</div>

If you follow the instructions in the original post, this should work out 👍

[이전 페이지](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238.md?page=2)

[다음 페이지](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238.md?page=4)
