配置tomcat集群重定向到nginx首页
来源:4-10 Tomcat集群实战-3(windows)

慕粉3884565
2019-01-16
upstream www.image.com{
server 127.0.0.1:8080;
server 127.0.0.1:9080;
#server 127.0.0.1:8080;
#server 127.0.0.1:9080;
}
server {
listen 80;
autoindex on;
server_name www.image.com;
access_log /usr/local/nginx/logs/access.log combined;
index index.html index.htm index.jsp index.php;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location = / {
root /product/front/mmall_fe/dist/view;
index index.html;
}
location ~ .*\.html$ {
root /product/front/mmall_fe/dist/view;
index index.html;
}
location / {
proxy_pass http://www.image.com/;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
proxy_pass http://www.image.com;
expires 30d;
}
location ~ .*\.(js|css)?$ {
proxy_pass http://www.image.com;
expires 7d;
}
}
清除过缓存的,我换在火狐也一样
1回答
-
亲爱的同学,你好,我是geely老师的助教。
通过远程控制,已经确定你的问题是因为静态资源文件找不到,所以才导致404的,帮你调整配置文件后已经可以成功访问了。祝你学习愉快哦!!!么么哒!!!
012019-01-16
相似问题