-----------------06 王梦楠——————————————————
listen       80;
        server_name  www.wmn.com;

        location / {
            root   /tmp/www;
            index  index.html index.htm;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /tmp/404;
        }

在Nginx 这个站点 此代码 基于HTTP协议是域名 (host)头 进行分发
listen       80;
        server_name  192.168.2.2;

        location / {
            root   /tmp/www;
            index  index.html index.htm;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /tmp/404;
        }
此代码 基于HTTP协议是IP (host)头 进行分发


server_name  www.wmn.com;

        location / {
            root   /tmp/www;
            index  index.html index.htm;
        }
        location ~ \.php$ {
            proxy_pass   http://192.168.2.4;
        }
        location ~ \.jsp$ {
            proxy_pass   http://192.168.2.2:8080;
        }
        error_page  404              /404.html;
        location = /404.html {
            root   /tmp/404;
        }
此代码 基于HTTP协议是 URI 头 进行分发 同时使用反向代理


listen       80;
        server_name  www.wmn1.com;
        location / {
            proxy_pass   http://192.168.2.2:8080;
     }
}
反向代理 如果人家访问 www.wmn1.com 这台服务器 会找 ip 为192.168.2.2:8080 这台服务器 处理
如果服务器 访问客户端 就是正想代理

server {
        listen       80;
        server_name  www.wmn1.com;
        location / {
            proxy_pass   http://192.168.2.2:8080;
        if ($http_user_agent ~ MSIE ) {
              proxy_pass  http://192.168.2.4;
        }
}

此代码 基于HTTP协议 浏览器类型头 进行分发


未完待续  
to be continued.............!!!!!!!!!