comparison proxy_if.t @ 952:e9064d691790

Tests: converted tests to run in parallel.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 21 Jun 2016 16:39:13 +0300
parents 355f2d5ff60f
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
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:8080; 41 listen 127.0.0.1:%%PORT_0%%;
42 server_name localhost; 42 server_name localhost;
43 43
44 location / { 44 location / {
45 proxy_pass http://127.0.0.1:8081/; 45 proxy_pass http://127.0.0.1:%%PORT_1%%/;
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:8081/replacement; 52 proxy_pass http://127.0.0.1:%%PORT_1%%/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:8081/replacement; 72 proxy_pass http://127.0.0.1:%%PORT_1%%/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:8081/replacement; 88 proxy_pass http://127.0.0.1:%%PORT_1%%/replacement;
89 89
90 limit_except POST { 90 limit_except POST {
91 proxy_pass http://127.0.0.1:8081; 91 proxy_pass http://127.0.0.1:%%PORT_1%%;
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:8081; 104 proxy_pass http://127.0.0.1:%%PORT_1%%;
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:8081/outer/$host; 117 proxy_pass http://127.0.0.1:%%PORT_1%%/outer/$host;
118 118
119 if ($arg_if) { 119 if ($arg_if) {
120 proxy_pass http://127.0.0.1:8081; 120 proxy_pass http://127.0.0.1:%%PORT_1%%;
121 } 121 }
122 122
123 location /variables/inner { 123 location /variables/inner {
124 proxy_pass http://127.0.0.1:8081; 124 proxy_pass http://127.0.0.1:%%PORT_1%%;
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:8082/outer; 133 proxy_pass https://127.0.0.1:%%PORT_2%%/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:8081; 140 proxy_pass http://127.0.0.1:%%PORT_1%%;
141 } 141 }
142 } 142 }
143 } 143 }
144 144
145 server { 145 server {
146 listen 127.0.0.1:8081; 146 listen 127.0.0.1:%%PORT_1%%;
147 listen 127.0.0.1:8082 ssl; 147 listen 127.0.0.1:%%PORT_2%% 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