nginx keep-alive without upstream指令

我们有一个nginx proxy_pass,它根据请求中的头字段动态设置主机和端口。

proxy_pass https://$http_x_host2:$http_x_port2;

因此,我根本没有"upstream"指令。在这种情况下,我如何控制"keepalive"指令。什么是默认值。

文档说没有默认设置。这是否意味着在我的情况下未设置上游连接的keep-alive?

在日志中,我看到请求和响应头都有"connection=Keep-Alive"。

因此,我们如何在没有上游指令的情况下调整"keepalive_value_"。

点赞