Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

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

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
nginxrefreshdiscusslongpollingWebsocket
1 ตอบกลับ
4304 มุมมอง
อวตาร
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
อวตาร
ละทิ้ง
Andry Ang

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

อวตาร
Ramon Rios
คำตอบที่ดีที่สุด

​

✅

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
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
Odoo bot answer is displayed before my question
discuss odoobot longpolling v17
อวตาร
1
พ.ค. 25
2201
Discuss >>> User status always offline
offline nginx status discuss
อวตาร
อวตาร
1
ก.ค. 23
4382
Exception: bus.Bus unavailable with config
nginx enterprise Enterprise odooV13 longpolling
อวตาร
0
เม.ย. 21
4602
Nginx odoo 16 proxy and method not allowed 405
nginx
อวตาร
อวตาร
2
ก.ย. 24
3826
How can I setup odoo on a path with nginx
nginx
อวตาร
อวตาร
1
พ.ค. 24
4643
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

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