大网数据广告活动
服务器运维问答

Risks of enabling nginx upstream keepalive

· 52CE 我爱测

Using nginx as HTTP reverse proxy for Apache with PHP backend (I need .htaccess flexibility for webmasters). Seeing http/1.0 used in Apache logs made me look up on how to enable keep-alive connection. Upon my search I found this …

问题原文

原帖链接 · logut · CC BY-SA 4.0

Using nginx as HTTP reverse proxy for Apache with PHP backend (I need .htaccess flexibility for webmasters). Seeing http/1.0 used in Apache logs made me look up on how to enable keep-alive connection.

Upon my search I found this blog post from Nginx https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#no-keepalives

By default, NGINX opens a new connection to an upstream (backend) server for every new incoming request. This is safe but inefficient,[...]

If default behavior is safe, what are the risks of enabling upstream keepalive ?

已采纳解答

原帖链接 · user195311 · CC BY-SA 4.0

Proxying a connection with keepalive is considered a risk because of HTTP desynchronization attacks / request smuggling. This occurs when the backend doesn't split different client requests in the exact same way as the frontend. Closing the connection after each request is the "safe" option, since this clearly delineates when the current request has ended.

See https://book.hacktricks.xyz/pentesting-web/http-request-smuggling for more information.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-04-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。