Nginx+Tomcat简单集群

1.软件准备
下载Nginx和Tomcat
解压到一个目录
2.修改Tomcat的端口
Tomcat1:修改Server.xml
Tomcat2:修改Server.xml
3.测试Tomcat是否正常运行
分别访问两个Tomcat
4.配置Nginx
主要配置
5.测试集群访问
启动Nginx
访问测试
附录:
6.配置文件
Tomcat1 的Server.xml配置文件
Tomcat2 的Server.xml配置文件
Nginx配置文件

1.软件准备

下载Nginx和Tomcat

Nginx:http://nginx.org/en/download.html 这里需要下载稳定版:Stable version

Tomcat:下载就不说了,这里使用apache-tomcat-6.0.14版本

解压到一个目录

2.修改Tomcat的端口

Tomcat1:修改Server.xml

D:\nginx_cluster\apache-tomcat-6.0.14_1\conf\server.xml

共修改3处内容:将以下端口都加1

  1. <!--第1处-->
  2. <Serverport="18005"shutdown="SHUTDOWN">
  3. <!--第2处-->
  4. <Connectorport="18080"protocol="HTTP/1.1"
  5. connectionTimeout="20000"
  6. redirectPort="8443"/>
  7. <!--第3处-->
  8. <Connectorport="18009"protocol="AJP/1.3"redirectPort="8443"/>

Tomcat2:修改Server.xml

D:\nginx_cluster\apache-tomcat-6.0.14_2\conf\server.xml

共修改3处内容:将以下端口都加2

  1. <!--第1处-->
  2. <Serverport="28005"shutdown="SHUTDOWN">
  3. <!--第2处-->
  4. <Connectorport="28080"protocol="HTTP/1.1"
  5. connectionTimeout="20000"
  6. redirectPort="8443"/>
  7. <!--第3处-->
  8. <Connectorport="28009"protocol="AJP/1.3"redirectPort="8443"/>

3.测试Tomcat是否正常运行

分别访问两个Tomcat

http://localhost:18080/

http://localhost:28080/

都出现猫的页面说明正常,为了区分不同的Tomcat,这里修改${Tmocat_home}\webapps\ROOT\ index.html文件内容,加入内容以便区分

  1. <h1>This Tomcat1</h1>

之后再次访问两个Tomcat

至此,两个Tomcat运行正常。

4.配置Nginx

修改Nginx的主配置文件:

D:\nginx_cluster\nginx-1.10.2\conf\ nginx.conf

  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
  14. # ‘$status $body_bytes_sent "$http_referer" ‘
  15. # ‘"$http_user_agent" "$http_x_forwarded_for"‘;
  16. #access_log logs/access.log main;
  17. sendfile on;
  18. #tcp_nopush on;
  19. #keepalive_timeout 0;
  20. keepalive_timeout 65;
  21. #gzip on;
  22. #监听localhost的80端口
  23. server {
  24. listen 80;
  25. server_name localhost;
  26. location /{
  27. proxy_connect_timeout 3;
  28. proxy_send_timeout 30;
  29. proxy_read_timeout 30;
  30. proxy_pass http://localhost;
  31. }
  32. }
  33. # another virtual host using mix of IP-, name-, and port-based configuration
  34. #
  35. #server {
  36. # listen 8000;
  37. # listen somename:8080;
  38. # server_name somename alias another.alias;
  39. # location / {
  40. # root html;
  41. # index index.html index.htm;
  42. # }
  43. #}
  44. #集群配置:服务器列表
  45. upstream localhost {
  46. server localhost:18080 weight=2;#服务器配置 weight是权重的意思,权重越大,分配的概率越大。
  47. server localhost:28080 weight=1;
  48. }
  49. # HTTPS server
  50. #
  51. #server {
  52. # listen 443 ssl;
  53. # server_name localhost;
  54. # ssl_certificate cert.pem;
  55. # ssl_certificate_key cert.key;
  56. # ssl_session_cache shared:SSL:1m;
  57. # ssl_session_timeout 5m;
  58. # ssl_ciphers HIGH:!aNULL:!MD5;
  59. # ssl_prefer_server_ciphers on;
  60. # location / {
  61. # root html;
  62. # index index.html index.htm;
  63. # }
  64. #}
  65. }

主要配置

至此,Nginx的简单配置就完成了。下面开始测试

5.测试集群访问

启动Nginx

进入到Nginx目录

启动命令为:start nginx

停止命令为:nginx –s stop

访问测试

访问:http://localhost/

Nginx内部配置了监听80端口,默认进行服务器的分发。

随便刷新测试了10次,共访问了Tomcat1共8次,Tomcat2共2次。可以看到权重越大,访问到的概率越大。

附录:

Nginx.conf配置

  1. #Nginx所用用户和组
  2. #user niumd niumd;
  3. #工作的子进程数量(通常等于CPU数量或者2倍于CPU)
  4. worker_processes 2;
  5. #错误日志存放路径
  6. #error_log logs/error.log;
  7. #error_log logs/error.log notice;
  8. error_log logs/error.log info;
  9. #指定pid存放文件
  10. pid logs/nginx.pid;
  11. events {
  12. #使用网络IO模型linux建议epoll,FreeBSD建议采用kqueue
  13. #use epoll;
  14. #允许最大连接数
  15. worker_connections 2048;
  16. }
  17. http {
  18. include mime.types;
  19. default_type application/octet-stream;
  20. #定义日志格式
  21. #log_format main ‘$remote_addr - $remote_user [$time_local] $request ‘
  22. # ‘"$status" $body_bytes_sent "$http_referer" ‘
  23. # ‘"$http_user_agent" "$http_x_forwarded_for"‘;
  24. #access_log off;
  25. access_log logs/access.log;
  26. client_header_timeout 3m;
  27. client_body_timeout 3m;
  28. send_timeout 3m;
  29. client_header_buffer_size 1k;
  30. large_client_header_buffers 44k;
  31. sendfile on;
  32. tcp_nopush on;
  33. tcp_nodelay on;
  34. #keepalive_timeout 75 20;
  35. include gzip.conf;
  36. #集群配置:服务器列表
  37. upstream localhost {
  38. server localhost:18080 weight=2;#服务器配置 weight是权重的意思,权重越大,分配的概率越大。
  39. server localhost:28080 weight=1;
  40. }
  41. server {
  42. listen 80;
  43. server_name localhost;
  44. location /{
  45. proxy_connect_timeout 3;
  46. proxy_send_timeout 30;
  47. proxy_read_timeout 30;
  48. proxy_pass http://localhost;
  49. }
  50. }
  51. }

6.配置文件

Tomcat1 的Server.xml配置文件

  1. <!-- Note: A "Server" is not itself a "Container", so you may not
  2. define subcomponents such as "Valves" at this level.
  3. Documentation at /docs/config/server.html
  4. -->
  5. <Serverport="18005"shutdown="SHUTDOWN">
  6. <!--APR library loader. Documentation at /docs/apr.html -->
  7. <ListenerclassName="org.apache.catalina.core.AprLifecycleListener"SSLEngine="on"/>
  8. <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  9. <ListenerclassName="org.apache.catalina.core.JasperListener"/>
  10. <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  11. <ListenerclassName="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  12. <ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
  13. <!-- Global JNDI resources
  14. Documentation at /docs/jndi-resources-howto.html
  15. -->
  16. <GlobalNamingResources>
  17. <!-- Editable user database that can also be used by
  18. UserDatabaseRealm to authenticate users
  19. -->
  20. <Resourcename="UserDatabase"auth="Container"
  21. type="org.apache.catalina.UserDatabase"
  22. description="User database that can be updated and saved"
  23. factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
  24. pathname="conf/tomcat-users.xml"/>
  25. </GlobalNamingResources>
  26. <!-- A "Service" is a collection of one or more "Connectors" that share
  27. a single "Container" Note: A "Service" is not itself a "Container",
  28. so you may not define subcomponents such as "Valves" at this level.
  29. Documentation at /docs/config/service.html
  30. -->
  31. <Servicename="Catalina">
  32. <!--The connectors can use a shared executor, you can define one or more named thread pools-->
  33. <!--
  34. <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
  35. maxThreads="150" minSpareThreads="4"/>
  36. -->
  37. <!-- A "Connector" represents an endpoint by which requests are received
  38. and responses are returned. Documentation at :
  39. Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
  40. Java AJP Connector: /docs/config/ajp.html
  41. APR (HTTP/AJP) Connector: /docs/apr.html
  42. Define a non-SSL HTTP/1.1 Connector on port 8080
  43. -->
  44. <Connectorport="18080"protocol="HTTP/1.1"
  45. connectionTimeout="20000"
  46. redirectPort="8443"/>
  47. <!-- A "Connector" using the shared thread pool-->
  48. <!--
  49. <Connector executor="tomcatThreadPool"
  50. port="8080" protocol="HTTP/1.1"
  51. connectionTimeout="20000"
  52. redirectPort="8443" />
  53. -->
  54. <!-- Define a SSL HTTP/1.1 Connector on port 8443
  55. This connector uses the JSSE configuration, when using APR, the
  56. connector should be using the OpenSSL style configuration
  57. described in the APR documentation -->
  58. <!--
  59. <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
  60. maxThreads="150" scheme="https" secure="true"
  61. clientAuth="false" sslProtocol="TLS" />
  62. -->
  63. <!-- Define an AJP 1.3 Connector on port 8009 -->
  64. <Connectorport="18009"protocol="AJP/1.3"redirectPort="8443"/>
  65. <!-- An Engine represents the entry point (within Catalina) that processes
  66. every request. The Engine implementation for Tomcat stand alone
  67. analyzes the HTTP headers included with the request, and passes them
  68. on to the appropriate Host (virtual host).
  69. Documentation at /docs/config/engine.html -->
  70. <!-- You should set jvmRoute to support load-balancing via AJP ie :
  71. <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
  72. -->
  73. <Enginename="Catalina"defaultHost="localhost">
  74. <!--For clustering, please take a look at documentation at:
  75. /docs/cluster-howto.html (simple how to)
  76. /docs/config/cluster.html (reference documentation) -->
  77. <!--
  78. <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  79. -->
  80. <!-- The request dumper valve dumps useful debugging information about
  81. the request and response data received and sent by Tomcat.
  82. Documentation at: /docs/config/valve.html -->
  83. <!--
  84. <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
  85. -->
  86. <!-- This Realm uses the UserDatabase configured in the global JNDI
  87. resources under the key "UserDatabase". Any edits
  88. that are performed against this UserDatabase are immediately
  89. available for use by the Realm. -->
  90. <RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"
  91. resourceName="UserDatabase"/>
  92. <!-- Define the default virtual host
  93. Note: XML Schema validation will not work with Xerces 2.2.
  94. -->
  95. <Hostname="localhost"appBase="webapps"
  96. unpackWARs="true"autoDeploy="true"
  97. xmlValidation="false"xmlNamespaceAware="false">
  98. <!-- SingleSignOn valve, share authentication between web applications
  99. Documentation at: /docs/config/valve.html -->
  100. <!--
  101. <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
  102. -->
  103. <!-- Access log processes all example.
  104. Documentation at: /docs/config/valve.html -->
  105. <!--
  106. <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
  107. prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
  108. -->
  109. </Host>
  110. </Engine>
  111. </Service>
  112. </Server>

Tomcat2 的Server.xml配置文件

  1. <!-- Note: A "Server" is not itself a "Container", so you may not
  2. define subcomponents such as "Valves" at this level.
  3. Documentation at /docs/config/server.html
  4. -->
  5. <Serverport="28005"shutdown="SHUTDOWN">
  6. <!--APR library loader. Documentation at /docs/apr.html -->
  7. <ListenerclassName="org.apache.catalina.core.AprLifecycleListener"SSLEngine="on"/>
  8. <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  9. <ListenerclassName="org.apache.catalina.core.JasperListener"/>
  10. <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  11. <ListenerclassName="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  12. <ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
  13. <!-- Global JNDI resources
  14. Documentation at /docs/jndi-resources-howto.html
  15. -->
  16. <GlobalNamingResources>
  17. <!-- Editable user database that can also be used by
  18. UserDatabaseRealm to authenticate users
  19. -->
  20. <Resourcename="UserDatabase"auth="Container"
  21. type="org.apache.catalina.UserDatabase"
  22. description="User database that can be updated and saved"
  23. factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
  24. pathname="conf/tomcat-users.xml"/>
  25. </GlobalNamingResources>
  26. <!-- A "Service" is a collection of one or more "Connectors" that share
  27. a single "Container" Note: A "Service" is not itself a "Container",
  28. so you may not define subcomponents such as "Valves" at this level.
  29. Documentation at /docs/config/service.html
  30. -->
  31. <Servicename="Catalina">
  32. <!--The connectors can use a shared executor, you can define one or more named thread pools-->
  33. <!--
  34. <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
  35. maxThreads="150" minSpareThreads="4"/>
  36. -->
  37. <!-- A "Connector" represents an endpoint by which requests are received
  38. and responses are returned. Documentation at :
  39. Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
  40. Java AJP Connector: /docs/config/ajp.html
  41. APR (HTTP/AJP) Connector: /docs/apr.html
  42. Define a non-SSL HTTP/1.1 Connector on port 8080
  43. -->
  44. <Connectorport="28080"protocol="HTTP/1.1"
  45. connectionTimeout="20000"
  46. redirectPort="8443"/>
  47. <!-- A "Connector" using the shared thread pool-->
  48. <!--
  49. <Connector executor="tomcatThreadPool"
  50. port="8080" protocol="HTTP/1.1"
  51. connectionTimeout="20000"
  52. redirectPort="8443" />
  53. -->
  54. <!-- Define a SSL HTTP/1.1 Connector on port 8443
  55. This connector uses the JSSE configuration, when using APR, the
  56. connector should be using the OpenSSL style configuration
  57. described in the APR documentation -->
  58. <!--
  59. <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
  60. maxThreads="150" scheme="https" secure="true"
  61. clientAuth="false" sslProtocol="TLS" />
  62. -->
  63. <!-- Define an AJP 1.3 Connector on port 8009 -->
  64. <Connectorport="28009"protocol="AJP/1.3"redirectPort="8443"/>
  65. <!-- An Engine represents the entry point (within Catalina) that processes
  66. every request. The Engine implementation for Tomcat stand alone
  67. analyzes the HTTP headers included with the request, and passes them
  68. on to the appropriate Host (virtual host).
  69. Documentation at /docs/config/engine.html -->
  70. <!-- You should set jvmRoute to support load-balancing via AJP ie :
  71. <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
  72. -->
  73. <Enginename="Catalina"defaultHost="localhost">
  74. <!--For clustering, please take a look at documentation at:
  75. /docs/cluster-howto.html (simple how to)
  76. /docs/config/cluster.html (reference documentation) -->
  77. <!--
  78. <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  79. -->
  80. <!-- The request dumper valve dumps useful debugging information about
  81. the request and response data received and sent by Tomcat.
  82. Documentation at: /docs/config/valve.html -->
  83. <!--
  84. <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
  85. -->
  86. <!-- This Realm uses the UserDatabase configured in the global JNDI
  87. resources under the key "UserDatabase". Any edits
  88. that are performed against this UserDatabase are immediately
  89. available for use by the Realm. -->
  90. <RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"
  91. resourceName="UserDatabase"/>
  92. <!-- Define the default virtual host
  93. Note: XML Schema validation will not work with Xerces 2.2.
  94. -->
  95. <Hostname="localhost"appBase="webapps"
  96. unpackWARs="true"autoDeploy="true"
  97. xmlValidation="false"xmlNamespaceAware="false">
  98. <!-- SingleSignOn valve, share authentication between web applications
  99. Documentation at: /docs/config/valve.html -->
  100. <!--
  101. <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
  102. -->
  103. <!-- Access log processes all example.
  104. Documentation at: /docs/config/valve.html -->
  105. <!--
  106. <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
  107. prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
  108. -->
  109. </Host>
  110. </Engine>
  111. </Service>
  112. </Server>

Nginx配置文件

  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
  14. # ‘$status $body_bytes_sent "$http_referer" ‘
  15. # ‘"$http_user_agent" "$http_x_forwarded_for"‘;
  16. #access_log logs/access.log main;
  17. sendfile on;
  18. #tcp_nopush on;
  19. #keepalive_timeout 0;
  20. keepalive_timeout 65;
  21. #gzip on;
  22. #监听localhost的80端口
  23. server {
  24. listen 80;
  25. server_name localhost;
  26. location / {
  27. proxy_connect_timeout 3;
  28. proxy_send_timeout 30;
  29. proxy_read_timeout 30;
  30. proxy_pass http://localhost;
  31. }
  32. }
  33. # another virtual host using mix of IP-, name-, and port-based configuration
  34. #
  35. #server {
  36. # listen 8000;
  37. # listen somename:8080;
  38. # server_name somename alias another.alias;
  39. # location / {
  40. # root html;
  41. # index index.html index.htm;
  42. # }
  43. #}
  44. #集群配置:服务器列表
  45. upstream localhost {
  46. server localhost:18080 weight=2;#服务器配置 weight是权重的意思,权重越大,分配的概率越大。
  47. server localhost:28080 weight=1;
  48. }
  49. # HTTPS server
  50. #
  51. #server {
  52. # listen 443 ssl;
  53. # server_name localhost;
  54. # ssl_certificate cert.pem;
  55. # ssl_certificate_key cert.key;
  56. # ssl_session_cache shared:SSL:1m;
  57. # ssl_session_timeout 5m;
  58. # ssl_ciphers HIGH:!aNULL:!MD5;
  59. # ssl_prefer_server_ciphers on;
  60. # location / {
  61. # root html;
  62. # index index.html index.htm;
  63. # }
  64. #}
  65. }

来自为知笔记(Wiz)

时间: 2024-10-04 10:17:14

Nginx+Tomcat简单集群的相关文章

Apache httpd + tomcat 简单集群

集群其实很简单,我们就来说一下httpd+tomcat集群都要注意哪些部分: 首先使用的东西有 apache-tomcat-8.0.32      下载地址: http://tomcat.apache.org/download-80.cgi httpd-2.4.18-x86-vc11-r3/Apache24     下载地址:http://httpd.apache.org/download.cgi        http://apache.opencas.org//httpd/binaries/

Nginx+Tomcat+MemCached 集群配置手册

系统实施文档 Nginx+Tomcat+MemCached 集群配置手册 目    录 第1章   概述 1.1   目标 互联网的快速发展带来了互联网系统的高负载和高可用性, 这要求我们在设计系统架构时会应用很多高性能的产品, 本文主要描述互联网架构中门户应用的集群的配置工作,最终用以指导系统实施. 1.2   预期读者 本文档用于指导系统工程师进行系统实施工作,架构师和系统工程师应该通读本文档,选择适当版本用于自己的系统架构. 第2章   产品介绍 2.1   Nginx介绍 Nginx是一

企业网站架构之Nginx+tomcat+memcached集群

nginx+tomcat+memcached应用 系统环境:RHEL6.4  x64   iptables -F   and selinux is disabled 主机角色:node1 :192.168.0.24 :lnmp环境 tomcat memcached node2 :192.168.0.99 : tomcat memcached 软件下载:在lnmp环境上测试tomcat,使用nginx简单发布jsp jdk-6u32-linux-x64.bin apache-tomcat-7.0.

Nginx+Tomcat搭建集群环境

集群概述与架构介绍 Tomcat集群能带来什么: 提高服务的性能,例如计算处理能力.并发能力等,以及实现服务的高可用性 提供项目架构的横向扩展能力,增加集群中的机器就能提高集群的性能 Tomcat集群实现方式: Tomcat集群的实现方式有多种,最简单的就是通过Nginx负载进行请求转发来实现 Tomcat单机架构图: 可能看了上面的Tomcat单机的架构图后,会 "想当然" 的觉得Tomcat集群架构是这样子的: 这种 "想当然" 的Tomcat集群会带来什么问题

Nginx + Tomcat搭建集群

一.Tomcat集群带来的好处 1.提高服务的性能,并发能力,以及高可用性 2.提供项目架构的横向扩展能力 二.Tomcat集群实现原理 通过Nginx负载均衡进行请求转发 三.Nginx + Tomcat搭建集群 (一).修改hosts文件 1. windows修改hosts 文件 c:\Windows\System32\drivers\etc\hosts 127.0.0.1 www.water.com 2. linux修改hosts文件 vi /etc/hosts (二).启动Nginx w

Nginx+tomcat配置集群负载均衡

转自:http://blog.csdn.net/bruce_6/article/details/38228299 相信很多人都听过nginx,这个小巧的东西慢慢地在吞食apache和IIS的份额.那究竟它有什么作用呢?可能很多人未必了解. 说到反向代理,可能很多人都听说,但具体什么是反向代理,很多人估计就不清楚了.摘一段百度百科上的描述: 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回

Nginx+Tomcat+Memcached集群Session共享

提供给大家整合实例: http://download.csdn.net/detail/zld1987/9577962 cookie是怎样工作的? 例如,我们创建了一个名字为login的Cookie来包含访问者的信息,创建Cookie时,服务器端的Header如下面所示,这里假设访问者的注册名是"Michael Jordan",同时还对所创建的Cookie的属性如path.domain.expires等进行了指定. Set-Cookie:login=Michael Jordan;path

【转】Nginx+Tomcat+Memcached集群Session共享

cookie是怎样工作的? 例 如,我们创建了一个名字为login的Cookie来包含访问者的信息,创建Cookie时,服务器端的Header如下面所示,这里假设访问者的注册名 是“Michael Jordan”,同时还对所创建的Cookie的属性如path.domain.expires等进行了指定. Set-Cookie:login=Michael Jordan;path=/;domain=msn.com; expires=Monday,01-Mar-99 00:00:01 GMT 上面这个H

转】Nginx+tomcat配置集群负载均衡

原博文出自于:http://blog.csdn.net/bruce_6/article/details/38228299         感谢! 相信很多人都听过nginx,这个小巧的东西慢慢地在吞食apache和IIS的份额.那究竟它有什么作用呢?可能很多人未必了解. 说到反向代理,可能很多人都听说,但具体什么是反向代理,很多人估计就不清楚了.摘一段百度百科上的描述: 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务