Articles > Odoo — Down for maintenance

Odoo — Down for maintenance

Give your users an explanation about what’s going on

Written by
Holden Rehg
Posted on
March 9, 2019

For every Odoo instance I configure, I add a Down For Maintenence page that displays when any 50x HTTP error occurs. This gives more information than a generic error page from the web server. That error page can really scare people when they don’t know what’s going on behind the scenes.

The web server (Nginx)

I’m using Nginx in this example, but it’s possible via any web server you are using. You can quickly install nginx on linux via sudo apt install nginx .

Here is an example of a very simple virtual host file located at /etc/nginx/sites-enabled/ on our server:

server {
    listen 80;
    client_max_body_size 128M;

    location / {
        proxy_pass http://localhost:20102;

    location /longpolling/ {
        proxy_pass http://localhost:20103;

    location ~ /[a-zA-Z0-9_-]*/static/ {
        proxy_pass http://localhost:20102;

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;

You’ll notice that we do not have https configured because it’s listening on port 80, we are using a domain name of , and we are assuming that there is an Odoo instance running on the server with an xmlrpcport of 20102 and a longpolling_port of 20103.

Below those common configurations is where we are setting up our Down For Maintenence HTML page.

error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;

This says that any time a 500, 502, 503, or 504 error occurs, show the user the HTML page located at /usr/share/nginx/html/50x.html .


Now let’s check out the HTML. This really can be anything you’d like, but as a simple example, I’m using a popular gist available that I just slightly modified.

<!doctype html>
    <title>Site Maintenance</title>
        body { text-align: center; padding: 150px; }
        h1 { font-size: 50px; }
        body { font: 20px Helvetica, sans-serif; color: #333; }
        article { display: block; text-align: left; width: 650px; margin: 0 auto; }
        a { color: #dc8100; text-decoration: none; }
        a:hover { color: #333; text-decoration: none; }</style>
    <h1>We will be back soon!</h1>
            Sorry for the inconvienence but we are performing some maintenence
            right now. Please <a href="">contact us</a>
            if you need something, otherwise we will be back online shortly!
        <p>- The Team</p>

Keep things simple to start. A short paragraph that explains that there’s something going on and that we are working on it. If anyone needs to reach out, they can send an email to us.

End result

You can test it out by taking down your Odoo instance. Depending on how your Odoo instance is configured, you may run a sudo service odoo stop or if you happen to be using Docker (which I recommend) then you may run a docker stop {my_container} or docker-compose stop .

Either way, once the instance is down then you can navigate to your URL. In the example, that would be

You’ll see your HTML page:

Thanks For Reading

I appreciate you taking the time to read any of my articles. I hope it has helped you out in some way. If you're looking for more ramblings, take a look at theentire catalog of articles I've written. Give me a follow on Twitter or Github to see what else I've got going on. Feel free to reach out if you want to talk!

open source
web development

Holden Rehg, Author

Posted March 9, 2019