1、问题。阿里云是80端口直接映射到tomcat的静态资源里面的index.html;但是一直无法实现
2、实现后静态资源无法访问;
直接上解决方法:nginx的配置文件
server
{
listen 80;
server_name example.cn;
location / {
root html;
index index.html index.htm;
proxy_pass http://192.168.129.87/index.html/;
}
location ~* \.(gif|jpg|jpeg|png|css|js|ico|html)$ {
proxy_pass http://192.168.129.87:31011;
}
}
就这简单的几行代码,能困绕到一下午;
不过现在很多框架已经不需要找到对应的index.html;
对于老的javaweb项目可能会遇到这种问题;