
nginx配置文件在 nginx-1.8.0\conf\nginx.conf
http {
     gzip  on;
    #静态文件
    server {
        listen       80;
        server_name  static.cnblog.com;
        location / {
            root   G:/source/static_cnblog_com;
        }
    }
    #html文件
    server {
        listen       80;
        server_name  127.0.0.1 localhost;
        location / {
            root   G:/source/html/mobile/dist;
            index  index.html index.htm;
        }
    }
}
如上图可以配置多个server,这样访问localhost即访问到了 G:/source/html/mobile/dist 目录, 还可以开启gzip,压缩html
原文:http://www.cnblogs.com/saysmy/p/6609796.html