Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

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

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
nginxrefreshdiscusslongpollingWebsocket
1 Odpowiedz
4445 Widoki
Awatar
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
Awatar
Odrzuć
Andry Ang

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

Awatar
Ramon Rios
Najlepsza odpowiedź

​

✅

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Odoo bot answer is displayed before my question
discuss odoobot longpolling v17
Awatar
1
maj 25
2236
Discuss >>> User status always offline
offline nginx status discuss
Awatar
Awatar
1
lip 23
4415
Exception: bus.Bus unavailable with config
nginx enterprise Enterprise odooV13 longpolling
Awatar
0
kwi 21
4662
Nginx odoo 16 proxy and method not allowed 405
nginx
Awatar
Awatar
2
wrz 24
3906
How can I setup odoo on a path with nginx
nginx
Awatar
Awatar
1
maj 24
4697
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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