Using Nginx Upstream to deploy OpenERP Openerp 6.1 uses werkzeug as the web service framework, and the performance is greatly improved compared with the previous cherrypy. However, werkzeug and cherrypy are not dedicated web servers. The common practice is to add an Nginx, Apache, or other server before openerp. The following describes how to deploy openerp using Nginx Upstream. 1. Assume that you have installed openerp and run Nginx debian/ubuntu: www.2cto.com 1 # apt-get install nginxredhat/centos on 127.0.0.1: 8069: 1 # yum install nginx 3 configure Nginx1 and modify/etc/nginx. conf, enable gzip compression 01 # vi/etc/nginx. conf02 03 -------------- nginx. the conf file must be excerpted. Example 04 gzip on; 05 gzip_disable "msie6"; 06 07 gzip_vary on; 08 gzip_proxied any; 09 www.2cto.com gzip_comp_level 6; 10 gzip_buffers 16 8 k; 11 gzip_http_version 1.1; 12 # Add a type of application/javascript13 gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml + rss text/javascript; if you want to enable gzip, the difference is not small. Http: // 127.0.0.1/web/webclient/js loaded on the oe homepage the file size is 1.4 MB before it is enabled, and 350.6 KB after it is enabled (viewed through firebug ). 2. Create the openerp Configuration File 01 # touch/etc/nginx/sites-enabled/openerp02 # vi/etc/nginx/sites-enabled/openerp03 04 ------------------ openerp file content 05 www.2cto.com 06proxy_temp_path /tmp/nginx_proxy_temp; 07proxy_cache_path/tmp/nginx_proxy_cache levels = keys_zone = oecache: 100 m inactive = 3d max_size = 1000 m; 08 09proxy_buffer_size 32 k; # Set Proxy Server (nginx) the buffer size for saving user header information is 10proxy_buffers 4 32 k; # Proxy_buffers buffer, set 11proxy_busy_buffers_size 64 k; # buffer size under high load (proxy_buffers * 2) 12proxy_temp_file_write_size 64 k; # Set the cache folder size, if the value is greater than this value, 13 14proxy_connect_timeout 60; 15proxy_send_timeout 60; 16proxy_read_timeout 3000; 17 www.2cto.com 18 upstream oeserver {19 server 127.0.0.1: 8069; 20} 21 22 server {23 24 server_name www.example.com; 25 26 root/var/www/openerp-6.1-1/openerp/addons; 27 28 location/{29 30 proxy_cache oecache; 31 # proxy_cache_key "$ host $ request_uri $ request_body"; 32 proxy_cache_key $ host $ request_uri $ request_body; 33 bytes 200 1d; 34 then any 1d; 35 then 36 then http_502 http_504 error timeout invalid_header; 37 proxy_pass_header Set-Cookie; 38 proxy_set_header Host $ host; 39 proxy_set_header X-Real-IP $ remote_addr; 40 pr Oxy_set_header X-Forwarded-For $ scheme; 41 proxy_redirect off; 42 43 proxy_pass http: // oeserver; 44 45 proxy_buffering on; 46 proxy_cache_valid 1d; 47 expires 1d; 48} 49 50 location ~ * \. (Js | css | png | jpg | jpeg | gif | ico) ${51 proxy_buffering on; 52 proxy_cache_valid 1d; 53 www.2cto.com expires 1d; 54} 55 56} complete! Nginx is only used as the front-end WEB server of openerp. Nginx can achieve load balancing of Openerp. The following table is not used. The author is wangbuke.