docker icon indicating copy to clipboard operation
docker copied to clipboard

Longpolling issue - Multiple Docker instances on server with multiple workers for each instance

Open IDCOLL opened this issue 4 years ago • 1 comments
trafficstars

I have multiple dockers installed on my server with each docker having multiple workers. The issue is my longpolling doesn`t work.

What should I change in my setup to make it work?

The image below shows all of the dockers running. image

Below is my Nginx config file for one of the sites....

server {
	root /var/www/html;
	index index.html index.htm index.nginx-debian.html;
	server_name website.co.za www.website.co.za;

	location / {
		proxy_read_timeout 720s;
        proxy_connect_timeout 720s;
        proxy_send_timeout 720s;
		proxy_pass http://127.0.0.1:8069;
		proxy_redirect off;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
	}

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/www.website.co.za/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.website.co.za/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot

}

server {
	listen 80;
	listen [::]:80;
	root /var/www/html;

	index index.html index.htm index.nginx-debian.html;
	server_name website.co.za www.website.co.za;

	location / {
		proxy_read_timeout 720s;
        proxy_connect_timeout 720s;
        proxy_send_timeout 720s;
		proxy_pass http://127.0.0.1:8069;
		proxy_redirect off;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
	}
}

IDCOLL avatar Feb 24 '21 09:02 IDCOLL

You need to add location /longpolling to passthrough those requests. Also make sure every instance is running at different ports.

A working NGINX example is published on Odoo deployment docs: https://www.odoo.com/documentation/14.0/setup/deploy.html#id7

codeagencybe avatar Apr 26 '21 19:04 codeagencybe