原则:所有静态请求走nginx , 动态请求走tomcat
一.配置nginx对shtml支持
1.vi nginx/conf/nginx.conf 添加
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
保存nginx.conf 。
2.后重启nginx.
二.配置tomcat对shtml支持
1.tomcat/conf/web.xml中去掉 ssi的severlet 和 filter的注释
2.在tomcat/conf/server.xml 的context标签下 加入 privileged=“true”
3.重启tomcat
配置以上其中一项即可,考虑到这俩服务的优势,选择nginx处理静态页面请求。