Mercurial > hg > nginx-tests
comparison uwsgi.t @ 801:d95c4b8e5517
Tests: more tests for passing requests to host given by expression.
This complements tests for scgi_pass, fastcgi_pass, uwsgi_pass with variables
that evaluate to an implicit upstream.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 09 Dec 2015 18:59:26 +0300 |
parents | dc2f8aac0553 |
children | eca9b1d19021 |
comparison
equal
deleted
inserted
replaced
800:51d3243a762f | 801:d95c4b8e5517 |
---|---|
19 ############################################################################### | 19 ############################################################################### |
20 | 20 |
21 select STDERR; $| = 1; | 21 select STDERR; $| = 1; |
22 select STDOUT; $| = 1; | 22 select STDOUT; $| = 1; |
23 | 23 |
24 my $t = Test::Nginx->new()->has(qw/http uwsgi/)->has_daemon('uwsgi')->plan(3) | 24 my $t = Test::Nginx->new()->has(qw/http uwsgi/)->has_daemon('uwsgi')->plan(4) |
25 ->write_file_expand('nginx.conf', <<'EOF'); | 25 ->write_file_expand('nginx.conf', <<'EOF'); |
26 | 26 |
27 %%TEST_GLOBALS%% | 27 %%TEST_GLOBALS%% |
28 | 28 |
29 daemon off; | 29 daemon off; |
40 | 40 |
41 location / { | 41 location / { |
42 uwsgi_pass 127.0.0.1:8081; | 42 uwsgi_pass 127.0.0.1:8081; |
43 uwsgi_param SERVER_PROTOCOL $server_protocol; | 43 uwsgi_param SERVER_PROTOCOL $server_protocol; |
44 uwsgi_param HTTP_X_BLAH "blah"; | 44 uwsgi_param HTTP_X_BLAH "blah"; |
45 } | |
46 | |
47 location /var { | |
48 uwsgi_pass $arg_b; | |
49 uwsgi_param SERVER_PROTOCOL $server_protocol; | |
45 } | 50 } |
46 } | 51 } |
47 } | 52 } |
48 | 53 |
49 EOF | 54 EOF |
79 unlike(http_head('/head'), qr/SEE-THIS/, 'no data in HEAD'); | 84 unlike(http_head('/head'), qr/SEE-THIS/, 'no data in HEAD'); |
80 | 85 |
81 like(http_get_headers('/headers'), qr/SEE-THIS/, | 86 like(http_get_headers('/headers'), qr/SEE-THIS/, |
82 'uwsgi request with many ignored headers'); | 87 'uwsgi request with many ignored headers'); |
83 | 88 |
89 like(http_get('/var?b=127.0.0.1:8081'), qr/SEE-THIS/, 'uwsgi with variables'); | |
90 | |
84 ############################################################################### | 91 ############################################################################### |
85 | 92 |
86 sub http_get_headers { | 93 sub http_get_headers { |
87 my ($url, %extra) = @_; | 94 my ($url, %extra) = @_; |
88 return http(<<EOF, %extra); | 95 return http(<<EOF, %extra); |