Mercurial > hg > nginx-tests
comparison proxy_if.t @ 974:882267679006
Tests: simplified parallel modifications in tests.
Mail tests were simplified in c227348453db.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 12 Jul 2016 17:39:03 +0300 |
parents | e9064d691790 |
children | 8ef51dbb5d69 |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
36 | 36 |
37 http { | 37 http { |
38 %%TEST_GLOBALS_HTTP%% | 38 %%TEST_GLOBALS_HTTP%% |
39 | 39 |
40 server { | 40 server { |
41 listen 127.0.0.1:%%PORT_0%%; | 41 listen 127.0.0.1:8080; |
42 server_name localhost; | 42 server_name localhost; |
43 | 43 |
44 location / { | 44 location / { |
45 proxy_pass http://127.0.0.1:%%PORT_1%%/; | 45 proxy_pass http://127.0.0.1:8081/; |
46 } | 46 } |
47 | 47 |
48 # request was sent to backend without uri changed | 48 # request was sent to backend without uri changed |
49 # to '/' due to if | 49 # to '/' due to if |
50 | 50 |
51 location /proxy-pass-uri { | 51 location /proxy-pass-uri { |
52 proxy_pass http://127.0.0.1:%%PORT_1%%/replacement; | 52 proxy_pass http://127.0.0.1:8081/replacement; |
53 | 53 |
54 if ($arg_if) { | 54 if ($arg_if) { |
55 # nothing | 55 # nothing |
56 } | 56 } |
57 | 57 |
67 # same as the above, but there is a special handling | 67 # same as the above, but there is a special handling |
68 # in configuration merge; it used to do wrong things with | 68 # in configuration merge; it used to do wrong things with |
69 # nested locations though | 69 # nested locations though |
70 | 70 |
71 location /proxy-pass-uri-lmt { | 71 location /proxy-pass-uri-lmt { |
72 proxy_pass http://127.0.0.1:%%PORT_1%%/replacement; | 72 proxy_pass http://127.0.0.1:8081/replacement; |
73 | 73 |
74 limit_except POST { | 74 limit_except POST { |
75 # nothing | 75 # nothing |
76 } | 76 } |
77 | 77 |
83 } | 83 } |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 location /proxy-pass-uri-lmt-different { | 87 location /proxy-pass-uri-lmt-different { |
88 proxy_pass http://127.0.0.1:%%PORT_1%%/replacement; | 88 proxy_pass http://127.0.0.1:8081/replacement; |
89 | 89 |
90 limit_except POST { | 90 limit_except POST { |
91 proxy_pass http://127.0.0.1:%%PORT_1%%; | 91 proxy_pass http://127.0.0.1:8081; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 # segmentation fault in old versions, | 95 # segmentation fault in old versions, |
96 # fixed to return 500 Internal Error in nginx 1.3.10 | 96 # fixed to return 500 Internal Error in nginx 1.3.10 |
99 | 99 |
100 set $true 1; | 100 set $true 1; |
101 | 101 |
102 if ($true) { | 102 if ($true) { |
103 # proxy_pass inside if | 103 # proxy_pass inside if |
104 proxy_pass http://127.0.0.1:%%PORT_1%%; | 104 proxy_pass http://127.0.0.1:8081; |
105 } | 105 } |
106 | 106 |
107 if ($true) { | 107 if ($true) { |
108 # no handler here | 108 # no handler here |
109 } | 109 } |
112 # normal proxy_pass and proxy_pass with variables | 112 # normal proxy_pass and proxy_pass with variables |
113 # use distinct field, and inheritance should be mutually | 113 # use distinct field, and inheritance should be mutually |
114 # exclusive | 114 # exclusive |
115 | 115 |
116 location /variables { | 116 location /variables { |
117 proxy_pass http://127.0.0.1:%%PORT_1%%/outer/$host; | 117 proxy_pass http://127.0.0.1:8081/outer/$host; |
118 | 118 |
119 if ($arg_if) { | 119 if ($arg_if) { |
120 proxy_pass http://127.0.0.1:%%PORT_1%%; | 120 proxy_pass http://127.0.0.1:8081; |
121 } | 121 } |
122 | 122 |
123 location /variables/inner { | 123 location /variables/inner { |
124 proxy_pass http://127.0.0.1:%%PORT_1%%; | 124 proxy_pass http://127.0.0.1:8081; |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 # ssl context shouldn't be inherited into nested | 128 # ssl context shouldn't be inherited into nested |
129 # locations with different proxy_pass, but should | 129 # locations with different proxy_pass, but should |
130 # be correctly inherited into if's | 130 # be correctly inherited into if's |
131 | 131 |
132 location /ssl { | 132 location /ssl { |
133 proxy_pass https://127.0.0.1:%%PORT_2%%/outer; | 133 proxy_pass https://127.0.0.1:8082/outer; |
134 | 134 |
135 if ($arg_if) { | 135 if ($arg_if) { |
136 # inherited from outer | 136 # inherited from outer |
137 } | 137 } |
138 | 138 |
139 location /ssl/inner { | 139 location /ssl/inner { |
140 proxy_pass http://127.0.0.1:%%PORT_1%%; | 140 proxy_pass http://127.0.0.1:8081; |
141 } | 141 } |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 server { | 145 server { |
146 listen 127.0.0.1:%%PORT_1%%; | 146 listen 127.0.0.1:8081; |
147 listen 127.0.0.1:%%PORT_2%% ssl; | 147 listen 127.0.0.1:8082 ssl; |
148 server_name localhost; | 148 server_name localhost; |
149 | 149 |
150 ssl_certificate localhost.crt; | 150 ssl_certificate localhost.crt; |
151 ssl_certificate_key localhost.key; | 151 ssl_certificate_key localhost.key; |
152 | 152 |