注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Perfect-World

以無法為有法,以無限為有限!

 
 
 

日志

 
 

nginx做weblogic的前端负载均衡器  

2015-01-22 10:25:56|  分类: Web Server |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

nginx做weblogic的前端负载均衡器

## set uid and gid of process

user webproxy ngboss;

## how many process will be started

worker_processes 10;

## worker_cpu_affinity define

worker_cpu_affinity 000000000100 000000001000 000000010000 000000100000 000001000000 000010000000 000100000000 001000000000 010000000000 100000000000;

## how many open files will be allowd of each process

worker_rlimit_nofile 51200;

## error log defind

error_log logs/error.log crit;

## save master process-id in file

pid logs/nginx.pid;

events {

## powered by epoll, good!

use epoll;

worker_connections 51200;

}

http {

include mime.types;

default_type text/html;

## access log format defind

log_format main '$remote_addr [$time_local] $request $status $body_bytes_sent';

## access log defind

access_log logs/access.log main;

## fast send file system call, good!

sendfile on;

tcp_nopush on;

tcp_nodelay on;

client_body_buffer_size 1024k;

proxy_connect_timeout 600;

proxy_read_timeout 600;

proxy_send_timeout 600;

proxy_buffer_size 8k;

proxy_buffers 4 32k;

proxy_busy_buffers_size 64k;

proxy_temp_file_write_size 1024k;

 

## set connection timeout (by second)

keepalive_timeout 30;

## gzip setting begin.

gzip on;

gzip_min_length 1k;

gzip_buffers 4 16k;

gzip_http_version 1.1;

gzip_comp_level 9;

gzip_vary off;

gzip_types text/plain text/javascript text/css text/xml application/xml;

## gzip setting end.

output_buffers 4 32k;

postpone_output 1460;

client_header_buffer_size 128k;

large_client_header_buffers 4 256k;

## default encoding

# charset GBK;

## app redirect && load-balancer start

# ngboss cluster

upstream ngboss_cluster {

ip_hash;

server 10.238.15.65:7101;

server 10.238.15.66:7201;

server 10.238.15.67:7301;

server 10.238.15.68:7401;

}

# saleserv cluster

upstream saleserv_cluster {

ip_hash;

server 10.238.15.65:8181;

server 10.238.15.66:8281;

server 10.238.15.67:8381;

server 10.238.15.68:8481;

server 10.238.15.65:8182;

server 10.238.15.66:8282;

server 10.238.15.67:8382;

server 10.238.15.68:8482;

}

# acctmanm cluster

upstream acctmanm_cluster {

ip_hash;

server 10.238.15.65:8191;

server 10.238.15.66:8291;

server 10.238.15.67:8391;

server 10.238.15.68:8491;

server 10.238.15.65:8192;

server 10.238.15.66:8292;

server 10.238.15.67:8392;

server 10.238.15.68:8492;

}

# custmanm cluster

upstream custmanm_cluster {

ip_hash;

server 10.238.15.65:8111;

server 10.238.15.66:8211;

}

# groupserv cluster

upstream groupserv_cluster {

ip_hash;

server 10.238.15.65:8183;

server 10.238.15.66:8283;

}

# salemanm cluster

upstream salemanm_cluster {

ip_hash;

server 10.238.15.65:8121;

server 10.238.15.66:8221;

}

server 10.238.15.66:8231;

}

# prodmcrm prodmbil bilmanm cluster

# chnlmanm cluster

upstream chnlmanm_cluster {

ip_hash;

server 10.238.15.65:8101;

server 10.238.15.66:8201;

}

# resmanm cluster

upstream resmanm_cluster {

ip_hash;

server 10.238.15.65:8131;

 

upstream prodmanm_cluster {

server 10.238.15.66:8261;

}

# copmanm cluster

upstream copmanm_cluster {

server 10.238.15.66:8271;

}

# sysmanm cluster

upstream sysmanm_cluster {

ip_hash;

server 10.238.15.65:8141;

server 10.238.15.66:8241;

}

# statmanm cluster

upstream statmanm_cluster {

ip_hash;

server 10.238.15.65:8151;

server 10.238.15.66:8251;

}

## app redirect && load-balancer end

server {

listen 10.238.15.101:18080;

server_name 10.238.15.101;

proxy_set_header X-Forwarded-For $remote_addr;

# charset GBK;

location /download {

root html;

proxy_redirect off;

}

location /saleserv {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://saleserv_cluster;

expires max;

break;

}

proxy_pass http://saleserv_cluster;

proxy_redirect off;

}

location /acctmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://acctmanm_cluster;

expires max;

break;

}

proxy_pass http://acctmanm_cluster;

proxy_redirect off;

}

location /custmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://custmanm_cluster;

expires max;

break;

}

proxy_pass http://custmanm_cluster;

proxy_redirect off;

}

location /groupserv {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://groupserv_cluster;

expires max;

break;

}

proxy_pass http://groupserv_cluster;

proxy_redirect off;

}

location /salemanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://salemanm_cluster;

expires max;

break;

}

proxy_pass http://salemanm_cluster;

proxy_redirect off;

}

location /chnlmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://chnlmanm_cluster;

expires max;

break;

}

proxy_pass http://chnlmanm_cluster;

proxy_redirect off;

}

location /resmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://resmanm_cluster;

expires max;

break;

}

proxy_pass http://resmanm_cluster;

proxy_redirect off;

}

location /prodmcrm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://prodmanm_cluster;

expires max;

break;

}

proxy_pass http://prodmanm_cluster;

proxy_redirect off;

}

location /prodmbil {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://prodmanm_cluster;

expires max;

break;

}

proxy_pass http://prodmanm_cluster;

proxy_redirect off;

}

location /bilmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://prodmanm_cluster;

expires max;

break;

}

proxy_pass http://prodmanm_cluster;

proxy_redirect off;

}

location /copmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://copmanm_cluster;

expires max;

break;

}

proxy_pass http://copmanm_cluster;

proxy_redirect off;

}

location /sysmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://sysmanm_cluster;

expires max;

break;

}

proxy_pass http://sysmanm_cluster;

proxy_redirect off;

}

location /statmanm {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://statmanm_cluster;

expires max;

break;

}

proxy_pass http://statmanm_cluster;

proxy_redirect off;

}

location /nginxstatus {

stub_status on;

access_log off;

allow all;

}

location / {

if ($request_uri ~* ".*/.(js|css|gif|jpg|jpeg|png|bmp|swf)$") {

proxy_pass http://ngboss_cluster;

expires max;

break;

}

proxy_pass http://ngboss_cluster;

proxy_redirect off;

}

 

# redirect server error pages to the static page /50x.html

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

 

可能您还对以下事情兴趣:

Nginx在Windows和Linux环境下安装

Nginx配置文件详细说明

Linux下Weblogic 11g R1安装和配置

Weblogic 10.1配置JNDI数据源

调优 WebSphere Application Server V7 性能

websphere7.0中配置oracle数据源及部署

WebLogic、WebSphere、JBOSS、Tomcat之间的区别

Tomcat下使用war包发布项目

配置WebLogic Server 11g 集群、Session复制(Windows)

Weblogic12 集群配置

WebLogic Server 11g (10.3.6) 和12c (12.1.1)安装步骤

linux(fedora、redhat)下配置web+ftp服务器全教程

J2SDK1.4.2下载安装及使用教程

Ubuntu/Debian上安装Nginx+php环境

使用XAMPP搭建本地JSP+PHP环境

基于nginx的linux web服务器配置

手机二维码访问:

 

  评论这张
 
阅读(2231)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016