[color=red][size=large]1.windows情况[/size][/color]
1)下载nginx下载地址:http://sysoev.ru/nginx/nginx-0.8.22.zip
2)解压修改\conf\nginx.conf文件
找到内容server {
在这上面加入如下内容:
upstream xueit.com {
server 127.0.0.1:8888;//两个tomcat一个端口号改为8888一个8080
server 172.0.0.1:8080;
}
3)找到location / {
root html;
index index.html index.htm;
}
把内容更改如下:
location / {
proxy_pass http://xueit.com;
proxy_redirect default;
}
[color=red][size=large]2.linux情况,正式应用可加入负载均衡[/size][/color]
可参考(未亲测):http://hi.baidu.com/snny2008/blog/item/f3b78f95833671187af48074.html
1)下载nginx下载地址:http://sysoev.ru/nginx/nginx-0.8.22.zip
2)解压修改\conf\nginx.conf文件
找到内容server {
在这上面加入如下内容:
upstream xueit.com {
server 127.0.0.1:8888;//两个tomcat一个端口号改为8888一个8080
server 172.0.0.1:8080;
}
3)找到location / {
root html;
index index.html index.htm;
}
把内容更改如下:
location / {
proxy_pass http://xueit.com;
proxy_redirect default;
}
[color=red][size=large]2.linux情况,正式应用可加入负载均衡[/size][/color]
可参考(未亲测):http://hi.baidu.com/snny2008/blog/item/f3b78f95833671187af48074.html