[REF] deploy: adapt deployment documentation to websocket

closes odoo/documentation#2618

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
tsm-odoo 2022-08-23 14:18:10 +00:00
parent 667da8bcff
commit 6ec20abc53
2 changed files with 17 additions and 11 deletions

View File

@ -215,11 +215,11 @@ LiveChat
-------- --------
In multiprocessing, a dedicated LiveChat worker is automatically started and In multiprocessing, a dedicated LiveChat worker is automatically started and
listening on :option:`the longpolling port <odoo-bin --longpolling-port>` but listening on :option:`the gevent port <odoo-bin --gevent-port>` but
the client will not connect to it. the client will not connect to it.
Instead you must have a proxy redirecting requests whose URL starts with Instead you must have a proxy redirecting requests whose URL starts with
``/longpolling/`` to the longpolling port. Other request should be proxied to ``/websocket/`` to the gevent port. Other request should be proxied to
the :option:`normal HTTP port <odoo-bin --http-port>` the :option:`normal HTTP port <odoo-bin --http-port>`
To achieve such a thing, you'll need to deploy a reverse proxy in front of Odoo, To achieve such a thing, you'll need to deploy a reverse proxy in front of Odoo,
@ -323,9 +323,15 @@ in ``/etc/nginx/sites-enabled/odoo.conf`` set:
access_log /var/log/nginx/odoo.access.log; access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log; error_log /var/log/nginx/odoo.error.log;
# Redirect longpoll requests to odoo longpolling port # Redirect websocket requests to odoo gevent port
location /longpolling { location /websocket {
proxy_pass http://odoochat; proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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 requests to odoo backend server # Redirect requests to odoo backend server
@ -381,12 +387,12 @@ notifications.
The solutions to support livechat/motifications in a WSGI application are: The solutions to support livechat/motifications in a WSGI application are:
* Deploy a threaded version of Odoo (instead of a process-based preforking * Deploy a threaded version of Odoo (instead of a process-based preforking
one) and redirect only requests to URLs starting with ``/longpolling/`` to one) and redirect only requests to URLs starting with ``/websocket/`` to
that Odoo, this is the simplest and the longpolling URL can double up as that Odoo, this is the simplest and the websocket URL can double up as the cron
the cron instance. instance.
* Deploy an evented Odoo via ``odoo-gevent`` and proxy requests starting * Deploy an evented Odoo via ``odoo-gevent`` and proxy requests starting
with ``/longpolling/`` to with ``/websocket/`` to
:option:`the longpolling port <odoo-bin --longpolling-port>`. :option:`the gevent port <odoo-bin --gevent-port>`.
.. _deploy/streaming: .. _deploy/streaming:

View File

@ -416,9 +416,9 @@ HTTP
Port on which the HTTP server listens, defaults to 8069. Port on which the HTTP server listens, defaults to 8069.
.. option:: --longpolling-port <port> .. option:: --gevent-port <port>
TCP port for long-polling connections in multiprocessing or gevent mode, TCP port for websocket connections in multiprocessing or gevent mode,
defaults to 8072. Not used in default (threaded) mode. defaults to 8072. Not used in default (threaded) mode.
.. option:: --proxy-mode .. option:: --proxy-mode