模块 ngx_http_mirror_module
示例:配置 Directives mirror mirror_request_body |
该模块 (1.13.4) 实现了
原始请求的镜像
通过创建后台镜像子请求。
对镜像子请求的响应将被忽略。ngx_http_mirror_module
示例配置
location / { mirror /mirror; proxy_pass http://backend; } location = /mirror { internal; proxy_pass http://test_backend$request_uri; }
Directives
语法: |
mirror |
---|---|
默认值: |
mirror off; |
上下文: |
http , ,server location |
设置原始请求将镜像到的 URI。 可以在同一配置级别上指定多个镜像。
语法: |
mirror_request_body |
---|---|
默认值: |
mirror_request_body on; |
上下文: |
http , ,server location |
指示是否镜像客户端请求正文。 启用后,将读取客户端请求正文 在创建镜像子请求之前。 在这种情况下,无缓冲的客户端请求正文代理 由 proxy_request_buffering、fastcgi_request_buffering、 scgi_request_buffering、 uwsgi_request_buffering Directives将被禁用。
location / { mirror /mirror; mirror_request_body off; proxy_pass http://backend; } location = /mirror { internal; proxy_pass http://log_backend; proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header X-Original-URI $request_uri; }