# A better "site not available" page

**URL:** https://meta.discourse.org/t/a-better-site-not-available-page/44826
**Category:** Site feedback
**Created:** [5월 26, 2016, 8:52오전 UTC](https://meta.discourse.org/t/a-better-site-not-available-page/44826 "2016-05-26T08:52:48Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [5월 26, 2016, 11:41오전 UTC](https://meta.discourse.org/t/a-better-site-not-available-page/44826/3 "2016-05-26T11:41:29Z")

</div>

I’m running such a setup on two instances. Actually, it was quite easy:

My outer nginx is configured [as described here](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247), and then I simply added an `error_page` directive and a location for the error page itself:

```plaintext
        location / {
                error_page 502 =502 /errorpages/discourse_offline.html;
                proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

        location /errorpages/ {
                alias /var/www/errorpages/;
        }
}

```

You might want to set up a nice-looking `discourse_offline.html` – unluckily, I only have an ugly one 😉

This will not take care of the `502 Bad Gateway` served by Discourse itself while it is starting up, though.

---

_[View the full topic](https://meta.discourse.org/t/a-better-site-not-available-page/44826)._
