http->conf = conf;
http->content_length_n = -1;
- http->keepalive = (conf->fetch_keepalive > 0);
+ http->keepalive = (conf->fetch_keepalive > 0
+ && !ngx_js_conf_dynamic_proxy(conf));
http->append_headers = ngx_js_fetch_append_headers;
http->ready_handler = ngx_js_fetch_process_done;
http->conf = conf;
http->content_length_n = -1;
- http->keepalive = (conf->fetch_keepalive > 0);
+ http->keepalive = (conf->fetch_keepalive > 0
+ && !ngx_js_conf_dynamic_proxy(conf));
ngx_qjs_arg(http->response.header_value) = JS_UNDEFINED;
js_fetch_proxy http://user:pass@127.0.0.1:%%PORT_8082%%;
js_content test.https_fetch;
}
+
+ location /https_via_dynamic_proxy_keepalive {
+ set $proxy_url http://user:pass@127.0.0.1:%%PORT_8082%%;
+ js_fetch_keepalive 4;
+ js_fetch_proxy $proxy_url;
+ js_content test.https_fetch;
+ }
}
server {
. $t->read_file('intermediate.crt'));
}
-$t->try_run('no js_fetch_proxy')->plan(4);
+$t->try_run('no js_fetch_proxy')->plan(6);
$t->run_daemon(\&https_proxy_daemon, $p2);
$t->run_daemon(\&dns_daemon, port(8981), $t);
qr/COM:2$/, 'https keepalive through proxy 2');
like(http_get("/https_via_proxy_keepalive?domain=example.org&port=$p4"),
qr/ORG:2$/, 'https keepalive through proxy different hostnames 2');
+like(http_get('/https_via_dynamic_proxy_keepalive?domain=example.com'),
+ qr/COM:1$/, 'https dynamic proxy keepalive disabled 1');
+like(http_get('/https_via_dynamic_proxy_keepalive?domain=example.com'),
+ qr/COM:1$/, 'https dynamic proxy keepalive disabled 2');
###############################################################################