Nginx+Tomcat,URL跳转的问题【在线等】
时间:2010-11-19
来源:互联网
问题起因:
网站是JSP的,通过Apache+Tomcat整合。
由于开发阶段的问题,Tomcat的server.xml中必须配置path【项目名】
需求:访问http://www.test.com时,跳转到http://www.test.com/xxx
以下是Apache、Tomcat的配置文件
Tomcat的配置如下:
<Context path="/xxx" docBase="/data/wwwroot/yyy" debug="0" reloadable="true"/>
Apache的配置如下:
<VirtualHost *:80>
ServerName www.test.com
DocumentRoot /data/wwwroot
DirectoryIndex index.html index.jsp
ProxyPass / ajp://192.168.1.100:8009/
ProxyPassReverse / ajp://192.168.1.100:8009/
RewriteEngine on
RewriteRule ^/$ http://www.test.com/xxx/ [R,L]
</VirtualHost>
目前打算使用Nginx替换Apache,Nginx启用负载均衡upstream,请问:
server{}中需要如何配置才能实现上面的需求?
网站是JSP的,通过Apache+Tomcat整合。
由于开发阶段的问题,Tomcat的server.xml中必须配置path【项目名】
需求:访问http://www.test.com时,跳转到http://www.test.com/xxx
以下是Apache、Tomcat的配置文件
Tomcat的配置如下:
<Context path="/xxx" docBase="/data/wwwroot/yyy" debug="0" reloadable="true"/>
Apache的配置如下:
<VirtualHost *:80>
ServerName www.test.com
DocumentRoot /data/wwwroot
DirectoryIndex index.html index.jsp
ProxyPass / ajp://192.168.1.100:8009/
ProxyPassReverse / ajp://192.168.1.100:8009/
RewriteEngine on
RewriteRule ^/$ http://www.test.com/xxx/ [R,L]
</VirtualHost>
目前打算使用Nginx替换Apache,Nginx启用负载均衡upstream,请问:
server{}中需要如何配置才能实现上面的需求?
作者: 鬼树雾爻 发布时间: 2010-11-19
没有回答?是我的描述不明确吗?
作者: 鬼树雾爻 发布时间: 2010-11-19
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28