Using NginxUpstream to deploy OpenERPOpenerp6.1 using werkzeug as the web service framework greatly improves the performance compared with the previous cherrypy. However, werkzeug and cherrypy are not dedicated web servers. The common practice is in openerp...
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. The http://127.0.0.1/web/webclient/js The file size is 1.4 mb before enabling, and 350.6 KB After enabling (viewed by 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. if the average webpage size is below 32 k, set 11proxy_busy_buffers_size 64 k; # buffer size under high load (proxy_buffers * 2) bytes 64 k; # set the cache folder size. if this value is greater than this value, 13 14proxy_connect_timeout 60; bytes 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 proxy_cache_valid 200 1d; 34 proxy_cache_valid any 1d; 35 www.2cto.com 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 proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; 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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.