nginx+多tomcat+http配置始终显示Welcome to nginx!
淡淡丹儿心 2019-08-12 08:25:55 upstream tomcat {
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:9080 weight=1;
}
server {
listen 80;
autoindex on;
server_name www.imooc.com;
access_log E:/access.log combined;
index index.html index.htm index.jsp index.php;
location / {
proxy_pass http://tomcat.com;
add_header Access-Control-Allow-Origin *;
}
}
上面代码是nginx的conf目录下的vhost文件加下的 www.imooc.com.conf文件
nginx.conf文件中在http节点下也配置了include vhost/*.conf;
两个tomcat的端口地址为:8080和9090
在C:/Windows/System32/drivers/etc/hosts下面也配置了如下
127.0.0.1 www.imooc.com
感觉以上配置没问题·,为什么访问www.imooc.com一直显示的是nginx的欢迎界面,无法实现tomcat界面下的在8080和9090两个端口来回切换。求大家帮忙指导一下?