openresty-1.13.6.1rc1 已经支持 ngx_http_mirror_module 了

1. rc1 版本地址

     https://openresty.org/download/openresty-1.13.6.1rc1.tar.gz

 2. 构建

     准备环境  prce  openssl 

     yum   install   openssl   openssl-devel

     yum   install   pcre-devel

     ./configure   && gmake  && gmake install

2. 配置

server {

listen      80;

server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

location / {

mirror /mirror; # 可配置多个

mirror_request_body off;

root html;

mirror /mirror2;

index index.html index.htm;

}

# mirror配置

location /mirror {

proxy_pass http://127.0.0.1:8080$request_uri;

proxy_pass_request_body off;

proxy_set_header Content-Length "";

proxy_set_header X-Original-URI $request_uri;

}

location /mirror2 {

proxy_pass http://127.0.0.1:8081$request_uri;

proxy_pass_request_body off;

proxy_set_header Content-Length "";

proxy_set_header X-Original-URI $request_uri;

}

error_page  500 502 503 504  /50x.html;

location = /50x.html {

root  html;

}

}

server {

listen      8080;

server_name  localhost;

location / {

root  html2;

index  index.html index.htm;

}

}

server {

listen      8081;

server_name  localhost;

location / {

root  html3;

index  index.html index.htm;

}

}

nginx 1.13.4 开始的 mirror 已经可以使用了,可以进行灰度以及流量拷贝了,春哥的更新速度还是挺快的

3. 参考文档

https://nginx.org/en/docs/http/ngx_http_mirror_module.html

//www.greatytc.com/p/07e1d7207476

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,308评论 19 139
  • Nginx简介 解决基于进程模型产生的C10K问题,请求时即使无状态连接如web服务都无法达到并发响应量级一万的现...
    魏镇坪阅读 6,286评论 0 9
  • 1.ngnix介绍 ngnix www服务软件 俄罗斯人开发 开源 性能很高 本身是一款静态WWW软件 静态小文件...
    逗比punk阅读 6,367评论 1 6
  • 1.简介:  Nginx:engine X ,2002年,开源,商业版 http协议:web服务器(类似于ht...
    尛尛大尹阅读 5,847评论 0 3
  • =========================================================...
    lavor阅读 8,812评论 0 5