diff --git a/odoo/dev.yml b/odoo/dev.yml index fba76f3..4757422 100644 --- a/odoo/dev.yml +++ b/odoo/dev.yml @@ -11,7 +11,6 @@ services: NGINX_HOST: localhost 127.0.0.1 ODOO_SERVICE: odoo ODOO_SERVER_NAMES: localodoo odoo ocb - command: /bin/true odoodev: extends: @@ -28,6 +27,8 @@ services: WORKERS: 2 LIMIT_TIME_CPU: 3000 LIMIT_TIME_REAL: 6000 + DEV: 1 + PROXY_MODE: "False" volumes: - /home/fabien/tmp/programming/py/server-tools:/opt/odoo/custom-addons/server-tools:ro diff --git a/odoo/nginx/odoo.conf b/odoo/nginx/odoo.conf index 39904e5..1d8f8eb 100644 --- a/odoo/nginx/odoo.conf +++ b/odoo/nginx/odoo.conf @@ -20,18 +20,20 @@ server { proxy_pass http://odooserver; proxy_http_version 1.1; proxy_read_timeout 300; - proxy_set_header Host ${DOLLSIGN}host; + proxy_set_header Host ${DOLLSIGN}http_host; proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host; proxy_redirect off; } location /longpolling { proxy_pass http://odoolongpoll; - proxy_set_header Host ${DOLLSIGN}host; + proxy_set_header Host ${DOLLSIGN}http_host; proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host; proxy_redirect off; } } diff --git a/odoo/nginx/odoo.conf.dev b/odoo/nginx/odoo.conf.dev index 1c80958..ac898c6 100644 --- a/odoo/nginx/odoo.conf.dev +++ b/odoo/nginx/odoo.conf.dev @@ -7,23 +7,25 @@ upstream odoolongpoll { } server { - listen 80; + listen ${PORT}; server_name ${ODOO_SERVER_NAMES}; client_max_body_size 200M; location / { proxy_pass http://odooserver; proxy_http_version 1.1; proxy_read_timeout 300; - proxy_set_header Host ${DOLLSIGN}host; + proxy_set_header Host ${DOLLSIGN}http_host; proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host; proxy_redirect http://$http_host/ https://$host:$server_port/; } location /longpolling { proxy_pass http://odoolongpoll; - proxy_set_header Host ${DOLLSIGN}host; + proxy_set_header Host ${DOLLSIGN}http_host; proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host; proxy_redirect off; } } diff --git a/odoo/odoo/genconf.sh b/odoo/odoo/genconf.sh index 728f05d..f4932a1 100644 --- a/odoo/odoo/genconf.sh +++ b/odoo/odoo/genconf.sh @@ -34,6 +34,7 @@ db_maxconn = ${DB_MAXCONN:=10} list_db = ${LIST_DB:=True} xmlrpc_port = ${XMLRPC_PORT:=8069} longpolling_port = ${LONGPOLLING_PORT:=8072} +proxy_mode = ${PROXY_MODE:=False} workers = ${WORKERS:=1} limit_time_cpu = ${LIMIT_TIME_CPU:=60} limit_time_real = ${LIMIT_TIME_REAL:=120} diff --git a/odoo/prod.yml b/odoo/prod.yml index 67f982d..f9bd775 100644 --- a/odoo/prod.yml +++ b/odoo/prod.yml @@ -19,3 +19,5 @@ services: context: ./odoo environment: LIST_DB: "False" + DEV: 0 + PROXY_MODE: "True"