From a2219d371b3e2bb5b70c217a3710c99c442bfa64 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Sat, 30 Sep 2023 04:24:38 -0500 Subject: [PATCH] fixed nginx for websocket --- nginx/default.conf | 15 +++++++++------ odoo/odoo.example.conf | 20 ++++++++++++-------- odoo/odoorc.sh | 20 ++++++++++++-------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/nginx/default.conf b/nginx/default.conf index 8e3467f..3d17cb8 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -22,11 +22,12 @@ server { } location / { + proxy_pass http://odoo: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; - proxy_set_header Host $host; - proxy_pass http://odoo:8069; # Add CORS headers add_header 'Access-Control-Allow-Origin' $CORS_ALLOWED_DOMAIN; @@ -40,11 +41,13 @@ server { } location /websocket { - proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://odoo:8072; + proxy_redirect off; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + 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; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header Host $host; - proxy_pass http://odoo:8072; } } diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index bfea948..bca84c4 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -259,29 +259,33 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} +;-----------------------------; +; External Integrations ; +;-----------------------------; + ;-------------; ; Redis ; ;-------------; -; Possible values: 1 or true +; -- Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; Defaults to is localhost +; -- Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; Defaults to 6379 +; -- Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; Sets the password for the AUTH command (optional) +; -- Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; Alternative way to define the Redis server address like rediss:// protocol. +; -- Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; Prefix for the session keys (optional) +; -- Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; Time in seconds before expiration of the sessions (default is 7 days) +; -- Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; Time in seconds before expiration of the anonymous sessions (default is 3 hours) +; -- Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index 56a2477..db971c8 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -374,31 +374,35 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} +;-----------------------------; +; External Integrations ; +;-----------------------------; + ;-------------; ; Redis ; ;-------------; -; Possible values: 1 or true +; -- Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; Defaults to is localhost +; -- Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; Defaults to 6379 +; -- Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; Sets the password for the AUTH command (optional) +; -- Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; Alternative way to define the Redis server address like rediss:// protocol. +; -- Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; Prefix for the session keys (optional) +; -- Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; Time in seconds before expiration of the sessions (default is 7 days) +; -- Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; Time in seconds before expiration of the anonymous sessions (default is 3 hours) +; -- Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} EOF