nginx + tomcat 負載

 

  1. http { 
  2.     include       mime.types; 
  3.     default_type  application/octet-stream; 
  4.  
  5.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 
  6.                       '$status $body_bytes_sent "$http_referer" ' 
  7.                       '"$http_user_agent" "$http_x_forwarded_for"'
  8.  
  9.     access_log  logs/access.log  main; 
  10.  
  11.     sendfile        on
  12.     #tcp_nopush     on
  13.  
  14.     #keepalive_timeout  0; 
  15.     keepalive_timeout  65; 
  16.  
  17.     #gzip  on
  18.      
  19.     upstream www.langaili.com{  
  20.        server 127.0.0.1:8080 weight=2;  
  21.        server 127.0.0.1:8081 weight=2;  
  22.        #ip_hash; 
  23.      } 
  24.  
  25.     server { 
  26.         listen       80; 
  27.         server_name  www.langaili.com; 
  28.         root  E:/work/html/weiyifa; 
  29.         #charset koi8-r; 
  30.  
  31.         access_log  logs/host.access.log  main; 
  32.  
  33.         #location / { 
  34.         #   root        E:/work/html/weiyifa; 
  35.         #    index  index.html index.htm; 
  36.         #} 
  37.      
  38.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { 
  39.             expires 30d; 
  40.         } 
  41.         location ~ .*\.(js|css)?$ { 
  42.             expires 1h; 
  43.         } 
  44.      
  45.         location / { 
  46.             index index
  47.             proxy_pass http://www.langaili.com; 
  48.         } 
  49.          
  50.  
  51.         #error_page  404              /404.html; 
  52.  
  53.         # redirect server error pages to the static page /50x.html 
  54.         # 
  55.         error_page   500 502 503 504  /50x.html; 
  56.         location = /50x.html { 
  57.             root   html; 
  58.         } 
  59.  
  60.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
  61.         # 
  62.         #location ~ \.htm$ { 
  63.         #    proxy_pass   http://127.0.0.1:8000; 
  64.         #} 
  65.  
  66.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
  67.         # 
  68.         #location ~ \.php$ { 
  69.         #    root           html; 
  70.         #    fastcgi_pass   127.0.0.1:9000; 
  71.         #    fastcgi_index  index.php; 
  72.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name; 
  73.         #    include        fastcgi_params; 
  74.         #} 
  75.  
  76.         # deny access to .htaccess files, if Apache's document root 
  77.         # concurs with nginx's one 
  78.         # 
  79.         #location ~ /\.ht { 
  80.         #    deny  all
  81.         #} 
  82.     } 
  83.  
  84.  
  85.     # another virtual host using mix of IP-, name-, and port-based configuration 
  86.     # 
  87.     #server { 
  88.     #    listen       9000; 
  89.     #    listen       localhost:8080; 
  90.     #    server_name  localhost; 
  91.     # 
  92.     #    location / { 
  93.     #        root   E:/work/html; 
  94.     #        index  index.html index.htm; 
  95.     #    } 
  96.     #} 
  97.  
  98.  
  99.     # HTTPS server 
  100.     # 
  101.     #server { 
  102.     #    listen       443; 
  103.     #    server_name  localhost; 
  104.  
  105.     #    ssl                  on
  106.     #    ssl_certificate      cert.pem; 
  107.     #    ssl_certificate_key  cert.key
  108.  
  109.     #    ssl_session_timeout  5m; 
  110.  
  111.     #    ssl_protocols  SSLv2 SSLv3 TLSv1; 
  112.     #    ssl_ciphers  HIGH:!aNULL:!MD5; 
  113.     #    ssl_prefer_server_ciphers   on
  114.  
  115.     #    location / { 
  116.     #        root   html; 
  117.     #        index  index.html index.htm; 
  118.     #    } 
  119.     #} 
  120.  

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章