server {
listen 80;
autoindex on;
server_name www.imooc.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 / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin *;
}
}
下面是/etc/hosts的配置:
192.168.2.197 www.imooc.com
下面是访问截图:
求解答.