[FIX]Add proxy_mode option and fix nginx configuration

This commit is contained in:
Fabien Bourgeois 2016-11-21 12:38:02 +01:00
parent 5fc7bf20c3
commit d0f06e0252
5 changed files with 14 additions and 6 deletions

View File

@ -11,7 +11,6 @@ services:
NGINX_HOST: localhost 127.0.0.1 NGINX_HOST: localhost 127.0.0.1
ODOO_SERVICE: odoo ODOO_SERVICE: odoo
ODOO_SERVER_NAMES: localodoo odoo ocb ODOO_SERVER_NAMES: localodoo odoo ocb
command: /bin/true
odoodev: odoodev:
extends: extends:
@ -28,6 +27,8 @@ services:
WORKERS: 2 WORKERS: 2
LIMIT_TIME_CPU: 3000 LIMIT_TIME_CPU: 3000
LIMIT_TIME_REAL: 6000 LIMIT_TIME_REAL: 6000
DEV: 1
PROXY_MODE: "False"
volumes: volumes:
- /home/fabien/tmp/programming/py/server-tools:/opt/odoo/custom-addons/server-tools:ro - /home/fabien/tmp/programming/py/server-tools:/opt/odoo/custom-addons/server-tools:ro

View File

@ -20,18 +20,20 @@ server {
proxy_pass http://odooserver; proxy_pass http://odooserver;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_read_timeout 300; 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-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host;
proxy_redirect off; proxy_redirect off;
} }
location /longpolling { location /longpolling {
proxy_pass http://odoolongpoll; 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-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host;
proxy_redirect off; proxy_redirect off;
} }
} }

View File

@ -7,23 +7,25 @@ upstream odoolongpoll {
} }
server { server {
listen 80; listen ${PORT};
server_name ${ODOO_SERVER_NAMES}; server_name ${ODOO_SERVER_NAMES};
client_max_body_size 200M; client_max_body_size 200M;
location / { location / {
proxy_pass http://odooserver; proxy_pass http://odooserver;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_read_timeout 300; 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-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; 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/; proxy_redirect http://$http_host/ https://$host:$server_port/;
} }
location /longpolling { location /longpolling {
proxy_pass http://odoolongpoll; 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-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for; proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host ${DOLLSIGN}http_host;
proxy_redirect off; proxy_redirect off;
} }
} }

View File

@ -34,6 +34,7 @@ db_maxconn = ${DB_MAXCONN:=10}
list_db = ${LIST_DB:=True} list_db = ${LIST_DB:=True}
xmlrpc_port = ${XMLRPC_PORT:=8069} xmlrpc_port = ${XMLRPC_PORT:=8069}
longpolling_port = ${LONGPOLLING_PORT:=8072} longpolling_port = ${LONGPOLLING_PORT:=8072}
proxy_mode = ${PROXY_MODE:=False}
workers = ${WORKERS:=1} workers = ${WORKERS:=1}
limit_time_cpu = ${LIMIT_TIME_CPU:=60} limit_time_cpu = ${LIMIT_TIME_CPU:=60}
limit_time_real = ${LIMIT_TIME_REAL:=120} limit_time_real = ${LIMIT_TIME_REAL:=120}

View File

@ -19,3 +19,5 @@ services:
context: ./odoo context: ./odoo
environment: environment:
LIST_DB: "False" LIST_DB: "False"
DEV: 0
PROXY_MODE: "True"