nginx more_set_headers配置
官方文档
https://github.com/openresty/headers-more-nginx-module#more_set_headers
例如我们想在nginx响应头中增加,nginx开始收到client请求,再到将请求发回给client期间消耗的时间,也就是nginx $request_time变量,官方说明文档Module ngx_http_log_module。
配置实例如下:
| server { listen 127.0.0.1:666 backlog=2048 ssl http2; ......... more_set_headers 'lb-req-time: $request_time';
|

本文详细介绍了如何在Nginx配置中使用headers-more-nginx-module的more_set_headers功能,实现实时添加请求处理时间和自定义请求ID到HTTP头。通过例子展示了如何将$request_time变量应用到响应头中,便于监控和日志记录。
3209

被折叠的 条评论
为什么被折叠?



