[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
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

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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}

View File

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