Nginx 的流量镜像模块

• 本文约115字,阅读大致需要1分钟 • Dev Notes

Nginx的流量镜像模块

Nginx发布了1.13.4版本,并且包含了一个流量镜像的模块ngx_http_mirror_module。

这对于线上系统就很好了,比如可以镜像部分流量来做测试、debug之类的

例子也很简单:

location / {
    mirror /mirror;
    proxy_pass http://backend;
}

location /mirror {
    internal;
    proxy_pass http://test_backend$request_uri;
}