http {
    server {
        listen  15001 default_server;

        location ^~ /proxy1 {
            proxy_pass http://127.0.0.1:15002/;
        }

        location ^~ /proxy2 {
            proxy_pass http://127.0.0.1:15002;
        }

        location ^~ /badproxy {
            proxy_pass http://127.0.0.1:25002/;
        }

        location / {
            index index.html;
            root testdata;
        }

        location ^~ /alias/ {
            alias nginxconf;
        }

        location /hello {
            echo "hello, I'am bingoohuang";
        }

        location /json1 {
            default_type application/json;
            return 200 '"result":"hello world!"}';
            echo '{"status":"success",';
        }

        location /json2 {
            default_type application/json;
            echo '{"status":"success","result":"hello world!"}';
        }
    }

    server {
        listen  15002 default_server;
        location / {
            echo "hello, $request";
        }
        location /demo {
            echo $request;
        }
    }

    server {
        listen  15003;
    }
}
