跟着老师安装好了,nginx,然后在nginx.conf中加入了include vhost/ *.conf,然后在vhost文件夹下面,建了个www.imooc.com.conf文件,里面配置如下
server {
default_type 'text/html';
charset utf-8;
listen 80;
autoindex on;
server_name www.imoocwlz.com;
access_log /usr/local/nginx/logs/access.log combined;
index index.html index.htm index.jsp index.php;
#error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location ~ /(mmall_fe|mmall_admin_fe)/dist/view/* {
deny all;
}
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin *;
}
}
然后,在/etc/hosts中,加入了
192.168.83.12 www.imoocwlz.com
192.168.83.12 image.imooc.com
192.168.83.12 s.imooc.com
然后启动tomcat,启动 nginx也启动,然后在虚拟机里面,如果访问www.imoocwlz.com
是展示的tomcat的页面,宿主机访问这个网址,就不可以,求问还缺了哪些操作吗