谢谢各位的回答,已经解决了。 需要在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教程有兴趣的朋友有所帮助。
