1,nginx的默认目录是 在usr/local这个目录之下的
/usr/local/nginx
2 修改 nginx.conf这么目录
3 在vhost内,新建文件 myhappymmall.com.conf 这个文件
upstream www.imooc.com{
server 120.79.**.**:8080;
server 120.79.**.**:9080;
}
server {
listen 80;
autoindex on;
server_name www.imooc.com 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 = / {
# 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.imooc.com/;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
proxy_pass http://www.imooc.com;
expires 30d;
}
location ~ .*\.(js|css)?$ {
proxy_pass http://www.imooc.com;
expires 7d;
}
}