哪个是更好的配置/优化:明确限制keepalive_timeout
或允许 Nginx 自行终止保活连接?
我看到了关于keepalive_timeout
Nginx 指令的两个相互矛盾的建议。它们如下:
# How long to allow each connection to stay idle; longer values are better
# for each individual client, particularly for SSL, but means that worker
# connections are tied up longer. (Default: 65)
keepalive_timeout 20;
Run Code Online (Sandbox Code Playgroud)
和
# You should remove keepalive_timeout from your formula.
# Nginx closes keepalive connections when the
# worker_connections limit is reached.
Run Code Online (Sandbox Code Playgroud)
该Nginx的 文档为keepalive_timeout
没有提及自动查杀,而我只看到这一建议一次,但它令我着迷。
该服务器专门为TLS 安全连接提供服务,所有未加密的连接都会立即重新路由到https://
相同 URL的版本。