我正在使用nginx作为代理服务器的多处理模式下的Odoo 8,我读了很多有关这个错误的问题,但我仍然无法解决我的问题,我认为我不能在一个gevent中运行odoo模式,我已经configuration了longpooling位置的nginx很多职位说,我的configuration如下: –
nginxconfiguration: –
upstream odoo8 { server 127.0.0.1:8069 weight=1 fail_timeout=0; } upstream odoo8-im { server 127.0.0.1:8072 weight=1 fail_timeout=0; } server { listen 80; server_name 138.201.xx.xx; access_log /var/log/nginx/odoo.access.log; error_log /var/log/nginx/odoo.error.log; location /longpolling { proxy_pass http://odoo8-im; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; # set headers 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 https; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } location / { proxy_pass http://odoo8; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_buffer_size 128k; proxy_buffers 16 64k; 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 https; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } location ~* /web/static/ { proxy_buffering on; proxy_pass 127.0.0.1:8069; } }
odoo.config: –
; This is the password that allows database operations: ; admin_passwd = admin db_host = False db_port = False db_user = odoo db_password = odoo addons_path = /opt/odoo/addons,/opt/odoo/addons/sale-workflow-8.0,/opt/odoo/addons/product-attribute-8.0,/opt/odoo/addons/e-commerce-8.0,/opt/odoo/addons/connector-magento-8.0,/opt/odoo/addons/connector-ecommerce-8.0,/opt/odoo/addons/connector-8.0 logfile = /var/log/odoo/odoo-server.log workers = 12 limit_time_real = 600 limit_time_cpu = 300
作为一个说明我正在运行odoo服务器作为服务和configuration如下: –
#!/bin/sh ### BEGIN INIT INFO # Provides: odoo-server # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: $network # Should-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Complete Business Application software # Description: Odoo is a complete suite of business tools. ### END INIT INFO PATH=/usr/local/bin:/bin:/sbin:/usr/bin DAEMON=/opt/odoo/openerp-server NAME=odoo-server DESC=odoo-server ODOO_CONNECTOR_CHANNELS=root:4,root.magento:2 # Specify the user name (Default: odoo). USER=odoo # Specify an alternate config file (Default: /etc/odoo-server.conf). CONFIGFILE="/etc/odoo-server.conf" # pidfile PIDFILE=/var/run/$NAME.pid # Additional options that are passed to the Daemon. DAEMON_OPTS="-c $CONFIGFILE" [ -x $DAEMON ] || exit 0 [ -f $CONFIGFILE ] || exit 0 checkpid() { [ -f $PIDFILE ] || return 1 pid=`cat $PIDFILE` [ -d /proc/$pid ] && return 0 return 1 } case "${1}" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ --chuid ${USER} --background --make-pidfile \ --exec ${DAEMON} -- ${DAEMON_OPTS} echo "${NAME}." ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \ --oknodo echo "${NAME}." ;; restart|force-reload) echo -n "Restarting ${DESC}: " start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \ --oknodo sleep 1 start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ --chuid ${USER} --background --make-pidfile \ --exec ${DAEMON} -- ${DAEMON_OPTS} echo "${NAME}." ;; *) N=/etc/init.d/${NAME} echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0
对不起,如果我的问题是重复的,但我真的不能解决:(
您的Odoo配置丢失:
proxy_mode = True
在你的nginx.conf中
location /longpolling { proxy_pass http://odoo8-im:8072; }