nginx配置

#user  nobody;

worker_processes  16;

error_log  logs/error.log  info;

pid        logs/nginx.pid;

worker_rlimit_nofile 65535;


events{

#use epoll;

worker_connections  4096;

 }

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"';

client_max_body_size 300m;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 60;

client_header_timeout  3m;  

client_body_timeout    3m;  

send_timeout           3m;

gzip  on;

gzip_min_length 1k;

gzip_buffers 4 16k;

gzip_http_version 1.1;

gzip_comp_level 2;

#gzip_types application/xml;

gzip_vary on;

proxy_set_header Host $host:$server_port;

proxy_set_header X-Real-IP $remote_addr; 

#proxy_set_header REMOTE-HOST $remote_addr; 

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_connect_timeout   60;

proxy_send_timeout      60;  

proxy_read_timeout      60;

proxy_buffer_size       16k;  

proxy_buffers           4 64k;  

proxy_busy_buffers_size 128k;  

proxy_temp_file_write_size 128k;

upstream myserver {

#ip_hash;

sticky;

server localhost:8001 weight=1;

server localhost:8002 weight=1;

server localhost:8003 weight=1;

server localhost:8004 weight=1;

}

server {

listen 80;

server_name  192.168.1.50;

root  "../";

index index.html index.htm;

location / {

proxy_next_upstream http_500 http_502 http_503 error timeout invalid_header;

location ~ \.(jsp|action)$ {

proxy_pass http://myserver;

}

location ~ \.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|mp3|GIF|JPG|JPEG|PNG|BMP)$ {

expires  30d;

}

location ~ \.(js|css|xml)?$ {

expires  1h;

}

}



error_page   500 502 503 504  /50x.html;

        location = /50x.html {

root   html;

}

  }

}



tomcat-server.xml配置



 

 

 

 

 

 

 

 

 


 

 

   

   

 


 

 

  

   

   

    

    

   

   

redirectPort="8663" URIEncoding="UTF-8" maxThreads="200"/>

   

              

   

   


   

   



   


     

   

                 channelSendOptions="8">  

  

         

                   expireSessionsOnShutdown="false"  

                   notifyListenersOnReplication="true"/>  

  

           

           

                        address="228.0.0.4"  

                        port="45564"  

                        frequency="500"  

                        dropTime="3000"/>  

           

                      address="192.168.1.71"  

                      port="4001"  

                      autoBind="100"  

                      selectorTimeout="5000"  

                      maxThreads="6"/>  

  

             

               

             

             


 

 

  

                 filter=""/>  

             

  

           

                    tempDir="/tmp/war-temp/"  

                    deployDir="/tmp/war-deploy/"  

                    watchDir="/tmp/war-listen/"  

                    watchEnabled="false"/>