This question has been flagged
2 Replies
143 Views

I have setup reverse proxy with Nginx, I followed a tutorial. Although everything works, we have a valid SSL connection (certbot) the chatbox doesn't auto refresh. I have read multiple tutorials but can't find the issue. In the comments for those tutorials I read that there are more people with same issue but not solution.

My nginx config is:

#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}


server {
server_name ##########;

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
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;

# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}

location /longpolling {
proxy_pass http://odoochat;
}

# common gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;


client_body_in_file_only clean;

My Odoo config is:

[options]
admin_passwd = ########
db_host = False
db_port = False
db_user = False
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo17/odoo17.log
addons_part = /opt/odoo17/odoo17/addons
proxy_mode = True
workers = 4

Server is Debian 22.

Avatar
Discard
Author Best Answer

I have replaced my nginx config file with yours but I still face the same problem. I have to refresh browser to see the chat refresh. Any idea what could cause this?

EDIT: I did restart nginx and odoo server after the changes.

Avatar
Discard
Best Answer

Sometimes chatbot doesn't auto refresh, then you can add manually nginx config, following bellow you can add ssl certificate  manually:

upstream odooserver {

     server 127.0.0.1:8069;

}


upstream odoochatserver {

    server 127.0.0.1:9072;

}


server {

  listen 80;

  listen [::]:80;

  server_name domain.com;

  return 301 https://$host$request_uri;

}


server {

     listen [::]:443 ssl http2;

     listen 443 ssl http2;


     server_name domain.com;


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

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


     access_log /var/log/nginx/subdomain_odoo_access.log;

     error_log /var/log/nginx/subdomain_odoo_error.log;


     proxy_read_timeout 720s;

     proxy_connect_timeout 720s;

     proxy_send_timeout 720s;


     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;


     # Redirect longpoll requests to odoo longpolling port

     location /longpolling {

        proxy_pass http://odoochatserver;

     }

     location / {

        proxy_redirect off;

        proxy_pass http://odooserver;

     }


     location ~* /web/static/ {

         proxy_cache_valid 200 90m;

         proxy_buffering on;

         expires 864000;

         proxy_pass http://odooserver;

     }


     gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;

     gzip on;

}

Avatar
Discard