Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Odoo Discuss Chat Messages Not Updating in Real-Time Without Refresh (Nginx + Longpolling Issue)

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
nginxrefreshdiscusslongpollingWebsocket
1 Atsakyti
4436 Rodiniai
Portretas
Abdullah Rizwan

How can I make Odoo Discuss (Live Chat) update messages without needing a page refresh?

Is my Nginx configuration correct for longpolling and WebSockets?

Do I need to adjust any Odoo settings for WebSockets to work properly?


Any guidance would be greatly appreciated!


(NGINX Sample File)


# Upstream Odoo servers

upstream odoo17 {

    server 127.0.0.1:1700;

}


upstream odoo17chat {

    server 127.0.0.1:8072;

}


# ---------------------- SHOP.COM ----------------------

server {

    listen 443 ssl;

    server_name shop.com www.shop.com;


    proxy_read_timeout 720s;

    proxy_connect_timeout 720s;

    proxy_send_timeout 720s;


    # Add Headers for Odoo Proxy Mode

    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;


    # Log Files

    access_log /var/log/nginx/shop.access.log;

    error_log /var/log/nginx/shop.error.log;


    # Redirect requests to Odoo Backend Server

    location / {

        proxy_redirect off;

        proxy_pass http://odoo17;

    }


    location /longpolling {

        proxy_pass http://odoo17chat;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header Host $host;

        proxy_http_version 1.1;

    }


    # SSL Configuration

    ssl_certificate /etc/letsencrypt/live/shop.com/fullchain.pem;

    ssl_certificate_key /etc/letsencrypt/live/shop.com/privkey.pem;

    include /etc/letsencrypt/options-ssl-nginx.conf;

    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

}


# Redirect HTTP to HTTPS

server {

    listen 80;

    server_name shop.com www.shop.com;

    return 301 https://$host$request_uri;

}


# ---------------------- WEB.SHOP.COM ----------------------

server {

    listen 443 ssl;

    server_name web.shop.com www.web.shop.com;


    proxy_read_timeout 720s;

    proxy_connect_timeout 720s;

    proxy_send_timeout 720s;


    # Add Headers for Odoo Proxy Mode

    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;


    # Log Files

    access_log /var/log/nginx/web_shop.access.log;

    error_log /var/log/nginx/web_shop.error.log;


    # Redirect requests to Odoo Backend Server

    location / {

        proxy_redirect off;

        proxy_pass http://odoo17;

    }


    location /longpolling {

        proxy_pass http://odoo17chat;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header Host $host;

        proxy_http_version 1.1;

    }


    ssl_certificate /etc/letsencrypt/live/web.shop.com/fullchain.pem;

    ssl_certificate_key /etc/letsencrypt/live/web.shop.com/privkey.pem;

}


(Sample Conf File for Odoo17)


[options]

admin_passwd = ****

http_port = 1700

logfile = /var/log/odoo/odoo17.log

addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17/custom

proxy_mode = True

workers = 2

db_name = False

db_user = odoo17

db_port = 5432

db_host = localhost

db_password = ****

xmlrpc_interface = 127.0.0.1

longpolling_port = 8072

dbfilter = ^%h$

0
Portretas
Atmesti
Andry Ang

Hi, can you confirm if you use any load balancers?

Portretas
Ramon Rios
Best Answer

​

✅

I found the solution yesterday here is the post https://www.odoo.com/forum/help-1/self-hosted-how-can-i-get-odoo-18-real-time-chat-working-requires-refresh-recurring-ir-cron-lock-errors-in-multi-db-docker-setup-282963

Assessment of Nginx Configuration:

This Nginx configuration is largely correct and robust for Odoo's longpolling and WebSockets. Here are the key points:

  • Separate Upstreams (odoo17, odoo17chat): This is a clean way to define the main Odoo application and its longpolling backend.
  • Correct Ports: 1700 for main Odoo and 8072 for chat are correctly passed to the upstreams.
  • Essential Headers: X-Forwarded-Host, X-Forwarded-For, X-Forwarded-Proto, X-Real-IP are set for Odoo's Proxy Mode.
    • Note on X-Real-IP: If using Cloudflare, X-Real-IP $remote_addr; might pass Cloudflare's IP. For the actual client IP, it's often better to use proxy_set_header X-Real-IP $http_cf_connecting_ip; if Cloudflare is sending that header, or use Nginx's real_ip module. However, the provided config is standard without Cloudflare specifics.
  • WebSocket Headers (Upgrade, Connection): These are correctly included in the location /longpolling block.
  • proxy_http_version 1.1;: This is CRUCIAL for Nginx when proxying WebSockets, ensuring the HTTP/1.1 protocol upgrade works correctly. This is a common fix for real-time issues.
  • Timeouts: proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout are set to 720s (12 minutes), which is generous and helps prevent premature disconnections for long-lived WebSocket connections.

Potential Minor Improvement for location /longpolling: The X-Forwarded-For and Host headers are already set in the main server block. While repeating them in location /longpolling is harmless, they are generally inherited. The Upgrade and Connection headers are the unique ones for this block.

"Do I need to adjust any Odoo settings for WebSockets to work properly?"

Yes, Odoo's odoo.conf needs to be correctly configured to work with this Nginx setup.

Assessment of Odoo odoo.conf settings:

  • http_port = 1700: This matches the odoo17 upstream in Nginx. Correct.
  • longpolling_port = 8072: This matches the odoo17chat upstream in Nginx. Correct.
  • proxy_mode = True: This is CRUCIAL for Odoo to correctly interpret the X-Forwarded-* headers from Nginx.
  • workers = 2: This enables multi-worker mode, which is good for production.
  • dbfilter = ^%h$: Correct for hostname-based multi-database setups.

Missing/Recommended Odoo Settings from your own troubleshooting journey (especially for Odoo 18):

Based on your recent successful troubleshooting, the following settings in odoo.conf are highly recommended for Odoo 18 stability and real-time performance:

  • Resource Limits:
    • limit_memory_hard = 2415919104 (e.g., ~2.25 GB per worker)
    • limit_memory_soft = 2013265920 (e.g., ~1.87 GB per worker)
    • limit_request = 8192
    • limit_time_cpu = 360
    • limit_time_real = 3600
    • limit_time_real_cron = 120 (Crucial for preventing cron timeouts)
  • WebSocket/Longpolling Specifics:
    • websocket_keep_alive_timeout = 600 (Helps maintain long-lived connections)
    • websocket_rate_limit_burst = 10
    • websocket_rate_limit_delay = 0.2
  • Session Storage (to prevent FileNotFoundError):
    • session_store = db (You already have this)
    • session_dir = False (Crucial to add, prevents Odoo from trying to write session files to disk when using session_store = db)
  • XML-RPC Configuration (for external integrations):
    • xmlrpc = True
    • xmlrpc_interface = 0.0.0.0
    • xmlrpc_port = 8069
    • xmlrpcs = True
    • xmlrpcs_interface = 0.0.0.0
    • xmlrpcs_port = 8071
✅
 This worked for me!
                        
[options]
admin_passwd = ############
addons_path = /mnt/extra-addons,/usr/lib/python3/dist-packaes/odoo/addons
session_store = db
session_dir = False
limit_memory_hard = 2415919104
limit_memory_soft = 2013265920
limit_request = 8192
limit_time_cpu = 360
limit_real_time = 3600
limit_time_real_cron = 120
longpolling_port=8072
;logfile = /var/log/odoo/odoo-server.log
;logrotate = True
;log_level = debug
http_port =
;http_timeout = 1800
max_cron_threads = 2
workers = 5
websocket_keep_alive_timeout = 600
websocket_rate_limit_burst = 10
websocket_rate_limit_delay = 0.2
xmlrpc = True
xmlrpc_interface =
xmlrpc_port = 8069
xmlrpcs = True
xmlrpcs_interface =
xmlrpcs_port = 8071
proxy_mode = True
dbfilter = ^%h$

Conclusion:

The Nginx configuration is well-structured for longpolling. The Odoo odoo.conf is also good, but adding the specific limit_ and websocket_ parameters (especially session_dir = False and limit_time_real_cron) from your recent Odoo 18 troubleshooting will significantly improve stability and ensure real-time chat functions reliably.

0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
Odoo bot answer is displayed before my question
discuss odoobot longpolling v17
Portretas
1
geg. 25
2235
Discuss >>> User status always offline
offline nginx status discuss
Portretas
Portretas
1
liep. 23
4413
Exception: bus.Bus unavailable with config
nginx enterprise Enterprise odooV13 longpolling
Portretas
0
bal. 21
4661
Nginx odoo 16 proxy and method not allowed 405
nginx
Portretas
Portretas
2
rugs. 24
3900
How can I setup odoo on a path with nginx
nginx
Portretas
Portretas
1
geg. 24
4695
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now