nginx.conf

#user  nobody;
worker_processes  4;
worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile  65535;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    use epoll; 
    worker_connections  65535;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;
    gzip_min_length    1000;
    gzip_types         text/plain text/css text/xml application/x-javascript application/xml application/json;

    server {
        listen       80;
        server_name  120.76.233.70;
        charset utf-8;
        access_log  logs/ning.access.log  main;
        index  index.jsp index.html index.do index.action;
        #root /home/tomcat/webapps/ROOT/;
        
        #location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
        #{
        #    root /home/tomcat/webapps/ROOT/;
        #    expires  7d; 
        #} 

        #location ~ (\.jsp)|(\.do)|(\.action)$
        location / 
        { 
            proxy_pass http://localhost:8080/; 
            proxy_redirect off; 
            proxy_set_header HOST $host; 
            proxy_set_header X-Real-IP $remote_addr; 
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
            client_max_body_size 10m; 
            client_body_buffer_size 128k; 
            proxy_connect_timeout 90; 
            proxy_send_timeout 90; 
            proxy_read_timeout 90; 
            proxy_buffer_size 4k; 
            proxy_buffers 4 32k; 
            proxy_busy_buffers_size 64k; 
            proxy_temp_file_write_size 64k; 
        }   

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  xiaovip.com www.xiaovip.com ningvip.com www.ningvip.com;
        charset utf-8;
        access_log  logs/xiaovip.access.log  main;     
        index  index.jsp index.html index.do index.action;  
        
        if ($host != 'www.xiaovip.com') {
            rewrite ^/(.*)$ http://www.xiaovip.com/$1 permanent;
        }
        location / {  
            rewrite ^/(.*)$ /b2g/$1 last;  
        }  
        location ^~ /b2g/ {  
            proxy_pass http://58.62.144.146:8888;  
       
        } 
        location ~* ^/.+$ { 
            proxy_pass http://58.62.144.146:8888; 
        }
        

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  gp.xiao.com;
        charset utf-8;
        access_log  logs/gp.xiao.access.log  main;
        index  index.jsp index.html index.do index.action;

        location / {
            proxy_pass http://58.62.144.146:8686;
        }

        #location ~* ^/.+$ {
        #    proxy_pass http://58.62.144.146:8686;
        #}

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    
    server {
        listen       80;
        server_name  www.xiao.com xiao.com www.ning.com ning.com;
        charset utf-8;
        access_log  logs/www.ning.access.log  main;     
        index index.php;
        root  /var/www/xiao;        

        if ($host != 'www.xiao.com') {
            rewrite ^/(.*)$ http://www.xiao.com/$1 permanent;
        }

        location ~ .*\.(php|php5)?$ {     
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;            
            include fastcgi_params;    
        }
    
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }

        location ~ /\.ht {
            deny  all;
        }

        include /var/www/xiao/stourweb_conf/nginx/*.conf;
      
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  m.xiao.com;
        charset utf-8;
        access_log  logs/m.ning.access.log  main;
        index  index.php index.html index.htm;
        root  /var/www/xiao/phone;

        location ~ .*\.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
        }


        include /var/www/xiao/stourweb_conf/nginx/*.conf;
         
        location ~ /uploads/{
            root /var/www/xiao;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
        #  expires      30d;
        }            

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  bbs.xiao.com;
        charset utf-8;
        access_log  logs/bbs.ning.access.log  main;
        index  index.php index.html index.htm;
        root  /var/www/discuz;

        location ~ .*\.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  en.xiao.com;
        charset utf-8;
        access_log  logs/en.ning.access.log  main;
        index  index.php index.html index.htm;
        root  /var/www/xiao-en;

        location ~ .*\.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  www.miao.com miao.com; 
        charset utf-8;
        access_log  logs/miao.access.log  main; 
        index  index.php index.html index.htm;
        root  /var/www/miao;

        location ~ .*\.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name  m.miao.com;
        charset utf-8;
        access_log  logs/m.miao.access.log  main;
        index  index.php index.html index.htm;
        root  /var/www/miao/mobile;

        location ~ .*\.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    
     server {
        listen       80;
        server_name  jipiao.xiao.com;
        charset UTF-8;
        index  index.html index.htm;
        root  html/jp;
        access_log  logs/jipiao.access.log  main;

        location / {
            try_files $uri $uri/ /index.html;
            #proxy_pass http://114.55.13.89:81;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
相關文章
相關標籤/搜索