openerp 与 nginx 整合

阅读更多

环境

openerp 6.1.1 以上版本

nginx 0.85 以上版本(我使用的是 lnmp 0.9版)

debian 6.0.5 和 ubutnu 12.04 通过测试

log_format  36-37.net  '$remote_addr - $remote_user [$time_local] $request '
             '$status $body_bytes_sent $http_referer '
             '$http_user_agent $http_x_forwarded_for';
proxy_temp_path /tmp/nginx_proxy_temp;
proxy_cache_path  /tmp/nginx_proxy_cache levels=1:2  keys_zone=oecache:100m inactive=3d
max_size=1000m;

proxy_buffer_size     64k;              #设置代理服务器(nginx)保存用户头信息的缓冲区大小
proxy_buffers         8 64k;            #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置
proxy_busy_buffers_size  128k;           #高负荷下缓冲大小(proxy_buffers*2)

proxy_connect_timeout      60;
proxy_send_timeout         60;
proxy_read_timeout         3000;
upstream oeserver {
	server 127.0.0.1:8069;
}
server
	{
		listen       80;
		server_name 36-37.net;
		root  /usr/lib/pymodules/python2.6/openerp/addons;

		location /
			{
				proxy_cache              oecache;
				proxy_cache_key $host$request_uri$request_body;
				proxy_cache_valid  200 304 1d;
				proxy_cache_valid  any   1d;

				proxy_next_upstream http_502 http_504 error timeout invalid_header;
				proxy_pass_header Set-Cookie;
				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_redirect  off;

				proxy_pass http://oeserver;

				proxy_buffering on;
				proxy_cache_valid       1d;
				expires 1d;
			}

		location ~* \.(js|css|png|jpg|jpeg|gif|ico)$
			{
				proxy_buffering on;
				proxy_cache_valid       1d;
				expires 1d;
			}

		access_log  /home/wwwlogs/36-37.net.log  36-37.net;
	}
 
  • 36-37.net.conf.gz (850 Bytes)
  • 下载次数: 6

你可能感兴趣的:(python,linux,nginx,openerp)