# HG changeset patch # User Sergey Kandaurov # Date 1405082276 -14400 # Node ID c1269426585da96cdffd5c80c359e7ea9fbac5c6 # Parent 05c46688b54b40b421a5bcdb43358304da71e0fd Tests: test for implicit upstream with IP literal and variable. diff --git a/proxy.t b/proxy.t --- a/proxy.t +++ b/proxy.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(3); +my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(4); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -43,6 +43,9 @@ http { proxy_pass http://127.0.0.1:8081; proxy_read_timeout 1s; } + location /var { + proxy_pass http://$arg_ip:$arg_port/; + } } } @@ -58,6 +61,9 @@ like(http_get('/multi'), qr/AND-THIS/, ' unlike(http_head('/'), qr/SEE-THIS/, 'proxy head request'); +like(http_get('/var?ip=127.0.0.1&port=8081'), qr/SEE-THIS/, + 'proxy url with IP literal and variable'); + ############################################################################### sub http_daemon {