# 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:** 2

<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월 13, 2016, 6:14오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/21 "2016-10-13T06:14:47Z")

</div>

Yes!  
Thanks for pointing this out, I updated my post to be more clear in this aspect.

---

<div class="post-metadata">

### Author: ![Harkirat\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harkirat_singh/32/60160_2.png) [@Harkirat\_Singh](https://meta.discourse.org/u/Harkirat_Singh)
#### Post date: [10월 13, 2016, 7:29오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/22 "2016-10-13T07:29:50Z")

</div>

> [@codinghorror](#):
>
> To make the cert auto renew in Ubuntu 14.04 LTS, I did this:
> 
> cd /etc/cron.daily  
> nano letsencrypt-renew

Would this also work with 16.04 LTS? Because I don’t think I need to install `certbot-auto` in 16.04 LTS.

---

<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월 13, 2016, 7:45오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/23 "2016-10-13T07:45:09Z")

</div>

The howto was created with 16.04, so my steps should match exactly 🙂

---

<div class="post-metadata">

### Author: ![Harkirat\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harkirat_singh/32/60160_2.png) [@Harkirat\_Singh](https://meta.discourse.org/u/Harkirat_Singh)
#### Post date: [10월 13, 2016, 8:01오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/24 "2016-10-13T08:01:23Z")

</div>

> [@fefrei](#):
>
> The howto was created with 16.04, so my steps should match exactly 🙂

I can understand that… but in your post you said:

> [@fefrei](#):
>
> ⏰ You must set a reminder run to letsencrypt renew before your cert expires in three months. For tips on automating this, see the certbot documentation.

So I wanted to know from @codinghorror if the auto renew steps he added would work with 16.04LTS?

@fefrei Can you guide me on how to auto renew without `certbot-auto`?

---

<div class="post-metadata">

### Author: ![Harkirat\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harkirat_singh/32/60160_2.png) [@Harkirat\_Singh](https://meta.discourse.org/u/Harkirat_Singh)
#### Post date: [10월 13, 2016, 8:03오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/25 "2016-10-13T08:03:42Z")

</div>

> [@Harkirat\_Singh](#):
>
> For tips on automating this, see the certbot documentation.

Now I feel stupid… let me check the documentation

---

<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월 13, 2016, 9:10오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/26 "2016-10-13T09:10:17Z")

</div>

> [@Harkirat\_Singh](#):
>
> @fefrei Can you guide me on how to auto renew without certbot-auto?

I use this simple shell script, run by _cron_:

```plaintext
#!/bin/bash
letsencrypt renew
/usr/sbin/service nginx reload

```

---

<div class="post-metadata">

### Author: ![Harkirat\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harkirat_singh/32/60160_2.png) [@Harkirat\_Singh](https://meta.discourse.org/u/Harkirat_Singh)
#### Post date: [10월 14, 2016, 6:01오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/27 "2016-10-14T06:01:18Z")

</div>

This basically means that you are renewing the certificate everyday, right?

---

<div class="post-metadata">

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

</div>

No it doesn’t. Cron jobs don’t have to be daily - you can pick any time period that you want.

---

<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월 14, 2016, 6:05오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/29 "2016-10-14T06:05:08Z")

</div>

`certbot renew` only processes certs it deems _due for renewal_. I run this script weekly, which effectively renews every two months or so.

---

<div class="post-metadata">

### Author: ![Harkirat\_Singh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harkirat_singh/32/60160_2.png) [@Harkirat\_Singh](https://meta.discourse.org/u/Harkirat_Singh)
#### Post date: [10월 14, 2016, 7:28오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/30 "2016-10-14T07:28:15Z")

</div>

you mean `letsencrypt renew`

---

<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월 14, 2016, 8:19오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/31 "2016-10-14T08:19:28Z")

</div>

True that – the client is being renamed to `certbot`, so I’m mixing them up all the time because the name depends on your distribution and version…

---

<div class="post-metadata">

### Author: ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)
#### Post date: [10월 14, 2016, 8:22오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/32 "2016-10-14T08:22:32Z")

</div>

Slightly off-topic, but if you use CloudFlare’s DNS you will get an offline page and a cached version of your site provided by them, without even touching your Discourse setup.

---

<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월 16, 2016, 7:59오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/33 "2016-10-16T07:59:27Z")

</div>

I did followed your @fefrei instructions and everything working fine. Thanks to your well documentation 👍. When I stop discourse I’m getting my special error page. But when I’m rebuilding discourse I’m getting the default 404 error page!.

Is there is anything I could do yet to fix this?

---

<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월 16, 2016, 8:12오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/34 "2016-10-16T08:12:02Z")

</div>

Wait, you should never get a 404. Can you post a screenshot of the error message? Does the error persist after rebuilding completes?

---

<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월 16, 2016, 8:17오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/35 "2016-10-16T08:17:30Z")

</div>

I’ll try to capture it for you with my second rebuild. But it is regular Nginx 404 error page, nothing special.  
No. After the rebuild completed everything working as expected. I’m getting my Discourse site running fine.

---

<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월 18, 2016, 10:58오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/36 "2016-10-18T22:58:55Z")

</div>

And this is requested screenshot.

 ![](https://global.discourse-cdn.com/meta/original/3X/6/0/60ceb11ec0da1241abd61f8e5681d80b276252c4.png)

I hope you have a solution for this.

---

<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월 19, 2016, 5:14오전 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/37 "2016-10-19T05:14:48Z")

</div>

I have no idea why this is happening ☹

One of the first steps of rebuilding is to stop the container. Your nginx shouldn’t be able to distinguish rebuilding from a stopped container even if it wanted to…

Maybe a close look at nginx’s logs could shed some light onto this?

---

<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월 19, 2016, 1:48오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/38 "2016-10-19T13:48:49Z")

</div>

Thank you @fefrei. I’m surprised too.

Where to locate the right Nginx’s logs?

---

<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월 19, 2016, 1:49오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/39 "2016-10-19T13:49:50Z")

</div>

I think the logs on your host are most interesting – depending on your Linux distribution, they should be in `/var/log/nginx/` or a similar place.

---

<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월 19, 2016, 2:09오후 UTC](https://meta.discourse.org/t/add-an-offline-page-to-display-when-discourse-is-rebuilding-or-starting-up/45238/40 "2016-10-19T14:09:33Z")

</div>

I’ve updated the initial post to also recommend enabling `http2` in the nginx configuration.

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

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