Nginx与tomcat集成
2014-04-15 11:36
323 查看
第一步:实现tomcat和nginx可以顺利启动。
请查看官方文档第二步:配置nginx的配置文件nginx/nginx.conf
找到location / { … } 元素,在花括号里面加入proxy_pass http://127.0.0.1:8080;[/code] 注意127.0.0.1不要写成localhost,否则可能会出现循环请求,而刷不出页面的情况;附加步骤:开启nginx负载均衡
在server标签前面配置<!-- lang: shell --> upstream backend { server 127.0.0.1:8080 weight=6 max_fails=2 fail_timeout=5; server 127.0.0.1:8081 weight=4 max_fails=2 fail_timeout=5; }
在server标签里面配置location / { #root html; #index index.html index.htm; proxy_pass http://backend; }
尝试访问http://localhost/,出现tomcat管理页,说明配置成功。
相关文章推荐
- nginx集成tomcat笔记
- nginx和Tomcat集成后发生的重定向问题分析和解决
- tomcat 7下spring 4.x mvc集成websocket以及sockjs完全参考指南(含nginx/https支持)
- Nginx和Tomcat集成常见问题
- nginx和Tomcat集成后发生的重定向问题分析和解决
- tomcat 7下spring 4.x mvc集成websocket以及sockjs完全参考指南(含nginx/https支持)
- nginx和Tomcat集成后发生的重定向问题分析和解决(非80端口的转发)
- windows 下nginx和tomcat集成
- nginx和Tomcat集成后发生的重定向问题分析和解决
- nginx配置和tomcat的集成
- nginx集成tomcat负载均衡
- tomcat 7下spring 4.x mvc集成websocket以及sockjs完全参考指南(含nginx/https支持)
- 关于Tomcat+Nginx集成获取客户端真实IP地址问题
- nginx和Tomcat集成后发生的重定向问题分析和解决
- Windows下Nginx1.8.1+Tomcat7.0.65集成实现负载均衡集群示例
- Centos6.2上做nginx和tomcat的集成及负载均衡(已实践)
- nginx和Tomcat集成后发生的重定向问题分析和解决
- nginx怎么集成tomcat配置文件怎么写,怎么设置
- CentOS 5.5 Nginx+JDK+MySQL+Tomcat(jsp)成功安装案例
- 配置Nginx反向代理Tomcat