我想要的是 访问 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教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号