Skip to content Skip to sidebar Skip to footer

Access Odoo Using Local Domain

If you successfully installing Odoo at first, you are able to access it by typing IP:PORT in your browser, for example 192.168.1.1:8069.
You think it's actually fine since it can be accessed, but actually it's not ideal. Imagine if you have coworker that repeatedly asking you what is the IP address since he/she is forgetful. That's surely annoying. That's why this tutorial will guide you how to make odoo accessible using domain.


Here is How :

  1. First, head to sites enabled folder by typing :

    cd /etc/nginx/sites-enabled
  2. Now, we will create a server block name server.com by typing

    nano server.com
  3. Now, type or paste these code below. The hashtag symbol (#) is a comment that will act as an explanation to you. You better to read it so you will understand and easily customise your own settings if necessary.

    #This port will be used as main operation of Odoo, which means user will use this port as daily basis :
    upstream odoo {
        server 127.0.0.1:8069;
    }

    #This port is serving as Messaging purpose. That means deployed Odoo worker will do responsibility to manage messaging and chatting services so incoming messages will be popped up and working realtime :
    upstream odoo-chat {
     server 127.0.0.1:8072 weight=1 fail_timeout=0;
    }

    server {

    # By default, it is using web port 80
        listen      80;

    # This will be your local address to access Odoo :
        server_name server.com;

    # The maximum file you may able to upload documents :
        client_max_body_size 200m;
        add_header Strict-Transport-Security max-age=2592000;

    # This is where debug log will be stored :
        access_log  /var/log/nginx/odoo.access.log;
        error_log   /var/log/nginx/odoo.error.log;

    # The maximum time limit amount for Nginx to make a process to Odoo. This will affect Odoo's validation loading. The more amount, the more time limit :
       proxy_read_timeout 3600;
       proxy_connect_timeout 3600;
       proxy_send_timeout 3600;
       proxy_set_header X-Forwarded-Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Real-IP $remote_addr;

    # Calling Odoo's main operation above :
        location / {
           proxy_pass http://192.168.1.95:8069;

    # Calling Odoo's Messaging above :
       location /longpolling {
           proxy_pass http://192.168.1.95:8072;
       }
    }
  4. Save by pressing :

    ctrl + x; y
  5. Restart Nginx by typing :
    service nginx restart
  6. Now you will be able to access odoo using server.com