1.打开nginx配置文件
vim /usr/loacl/nginx/conf/nginx.conf
2.修改service结点(注意$号后面要加空格)
#配置动态资源代理到tomcat
location ~.*\.(jsp|do|action)$ {
proxy_pass http://119.29.116.96:8080;
}
#配置静态资源到文件目录
location ~.*\.(html|js|css|gif|jpg|jpeg|png)$ {
root html;
index index.html index.htm;
}
3.检查配置文件
./nginx -t
4.重启nginx
./nginx -s reload
5.测试访问.jsp后缀,和测试.html后缀。如果跳转的页面不同,则配置成功