Chinaunix首页 | 论坛 | 博客
  • 博客访问: 48119
  • 博文数量: 4
  • 博客积分: 170
  • 博客等级: 入伍新兵
  • 技术积分: 50
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-31 10:15
文章分类

全部博文(4)

文章存档

2012年(4)

我的朋友

分类: 虚拟化

2012-03-20 13:54:56

    (相关技术文档下载:
自从网站更新AAF后,www站点Server(IIS)负载不停的攀升,从当初的平均30%攀升到70%;CPU一直保持这么高的负载,会有问题的;便开始尝试用Nginx来挂在IIS服务器前面,来降低IIS服务器负载;
          Nginx来做反响代理,架构这样的,Nginx 放在F5下面一个VIP Pool里面,Nginx从IISPoo里面反响代理,配置文件如下:
user daemon daemon;

worker_processes 8;

error_log /usr/local/nginx/logs/nginx_error.log crit;

pid                /var/run/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;

events
{
use epoll;
worker_connections 65535;
}

http
{
include             mime.types;
default_type application/octet-stream;

charset utf-8;

server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;

sendfile on;
tcp_nopush         on;
tcp_nodelay on;

keepalive_timeout 60;

client_body_buffer_size 512k;
proxy_connect_timeout        5;
proxy_read_timeout             60;
proxy_send_timeout             5;
proxy_buffer_size                16k;
proxy_buffers                        4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;

gzip on;
gzip_min_length 1k;
gzip_buffers         4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types             text/plain application/x-javascript text/css application/xml;
gzip_vary on;
upstream myproject {
                                 server x.x.x.x weight=3;
        }

server {
                listen 80;
                server_name
                location / {
                    proxy_set_header Host $host;
                    proxy_set_header X-Forwarded-For $remote_addr;
                    proxy_pass
                }
        }
server {
                listen 80;
                server_name xxxx.com;
                location / {
                    proxy_set_header Host $host;
                    proxy_set_header X-Forwarded-For $remote_addr;
                    proxy_pass
                }
        }
server
         {
                listen 80;
                server_name x.x.x.x;
                location /Nginxstatus {
                stub_status on;
                access_log     off;
                auth_basic “NginxStatus”;
                #auth_basic_user_file htpasswd;
                 }
         }
}

 
 
 

本文出自 “妖哥的博客” 博客,请务必保留此出处http://yaoge.blog.51cto.com/319773/327028

阅读(824) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~