您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

nginx tomcat 配置 多个 二级域名 多个项目

2024/6/11 22:16:43发布14次查看
我想要的是 访问 news.test.com , 实际访问的是 tomcat 下面的news 项目 ,访问 forum.test.com ,实际访问的是 tomcat 下面的 luntan 项目,但是浏览器地址 栏url news.test.com 、forum.test.com 不变 ,不要变成 news.test.com/news 或者 forum.test.com/luntan 这样的,如何配置? 请教
谢谢各位的回答,已经解决了。 需要在tomcat里面配置虚拟host。 host名称为需要访问的域名。
path= docbase=/opt/tomcat/webapps/news . 如果访问首页域名后面不加访问路径的话。path需要为“”。 docbase 指向项目名称。 在此与大家分享下。再次感谢各位的回答、^_^
server{    listen 80;    server_name news.test.com;//前台访问地址    root {web_root_path}/news;    access_log {log_root_path}/news.log;    location /{          proxy_pass http://news; //tomcat后台处理地址    }  }server{    listen 80;    server_name forum.test.com;//前台访问地址    root {web_root_path}/forum;    access_log {log_root_path}/forum.log;    location /{          proxy_pass http://forum; //tomcat后台处理地址    }  }
以上就介绍了nginx tomcat 配置 多个 二级域名 多个项目,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product