Skip to content

Commit 29e8497

Browse files
committed
Don't bind to additional port when it isn't necessary.
1 parent 1e6859a commit 29e8497

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

t/proxy.t

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,11 @@ plan tests => repeat_each() * (blocks() * 3 + 3 * 1);
1010
our $http_config = <<'_EOC_';
1111
proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m;
1212
proxy_temp_path /tmp/ngx_cache_purge_temp 1 2;
13-
14-
server {
15-
listen 8100;
16-
17-
location / {
18-
root /etc;
19-
}
20-
}
2113
_EOC_
2214

2315
our $config = <<'_EOC_';
2416
location /proxy {
25-
proxy_pass http://127.0.0.1:8100/;
17+
proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd;
2618
proxy_cache test_cache;
2719
proxy_cache_key $uri$is_args$args;
2820
proxy_cache_valid 3m;
@@ -32,6 +24,10 @@ our $config = <<'_EOC_';
3224
location ~ /purge(/.*) {
3325
proxy_cache_purge test_cache $1$is_args$args;
3426
}
27+
28+
location = /etc/passwd {
29+
root /;
30+
}
3531
_EOC_
3632

3733
worker_connections(128);

0 commit comments

Comments
 (0)