惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Last Watchdog
The Last Watchdog
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Help Net Security
Attack and Defense Labs
Attack and Defense Labs
O
OpenAI News
博客园 - 聂微东
Y
Y Combinator Blog
N
News | PayPal Newsroom
IT之家
IT之家
C
Cybersecurity and Infrastructure Security Agency CISA
Engineering at Meta
Engineering at Meta
L
LangChain Blog
L
Lohrmann on Cybersecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
C
CERT Recently Published Vulnerability Notes
爱范儿
爱范儿
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
G
Google Developers Blog
PCI Perspectives
PCI Perspectives
The Register - Security
The Register - Security
H
Heimdal Security Blog
V
Visual Studio Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
TaoSecurity Blog
TaoSecurity Blog
博客园 - Franky
T
The Blog of Author Tim Ferriss
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
The Hacker News
The Hacker News
U
Unit 42
Security Latest
Security Latest
The GitHub Blog
The GitHub Blog

博客园 - 大侠(cer)

阿里巴巴又抄袭创业公司产品,这次已被告上法庭(一) 手机app传统邀请码安装与免邀请码安装区别,如何选择呢? 好用的一些开源系统 一个搞笑的招聘启事 java和android及IOS对接RSA加密经验 mysql大数据表改表结构方案 android开发中监控android软件网络请求的软件Charles使用入门 android IOC框架学习记录 java分布式事务 android开发时使用游标时一定要关闭 今天发现ConcurrentHashMap的key是不区分大小写的 js方法isNaN使用时注意,“1.”这样子的东西他也会认为是数字 nginx增加lua支持 两台机器使用rsync同步数据(手工执行命令同步)(使用推的方式) 用户中心 - 博客园 ubuntu服务器配制jmagick环境 windows中架设基于Apache的svn服务器 amoeba学习 CentOS安装thrift
使用nginx+lua实现web项目的灰度发布
大侠(cer) · 2012-09-29 · via 博客园 - 大侠(cer)

1.问题:小团队,快速迭代开发,版本发布没有经过测试就要放出去,怎样在内网测试过后在外网能在真实环境让内部人员再过一次测试且不影响外网用户

2.实现思想:

a.至少要有两台机器

b.公司是统一出口IP

c.根据IP将请求转发到不同的机器

3.nginx配制: 

location / {

content_by_lua '

            myIP = ngx.req.get_headers()["X-Real-IP"]

            if myIP == nil then

                myIP = ngx.req.get_headers()["x_forwarded_for"]

            end

            if myIP == nil then

                myIP = ngx.var.remote_addr

            end

            if myIP == "公司出口IP" then

                ngx.exec("@client")

            else

                ngx.exec("@client_test")

            end

        ';

location @client{

    proxy_next_upstream     error timeout;

    proxy_redirect          off;

    proxy_set_header        Host $host;

    #proxy_set_header        X-Real-IP $remote_addr;

    proxy_set_header        X-Real-IP $http_x_forwarded_for;

    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

    client_max_body_size    100m;

    client_body_buffer_size 256k;

    proxy_connect_timeout   180;

    proxy_send_timeout      180;

    proxy_read_timeout      180;

    proxy_buffer_size       8k;

    proxy_buffers           8 64k;

    proxy_busy_buffers_size 128k;

    proxy_temp_file_write_size 128k;

    proxy_pass http://client;

}

location @client_test{

    proxy_next_upstream     error timeout;

    proxy_redirect          off;

    proxy_set_header        Host $host;

    #proxy_set_header        X-Real-IP $remote_addr;

    proxy_set_header        X-Real-IP $http_x_forwarded_for;

    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

    client_max_body_size    100m;

    client_body_buffer_size 256k;

    proxy_connect_timeout   180;

    proxy_send_timeout      180;

    proxy_read_timeout      180;

    proxy_buffer_size       8k;

    proxy_buffers           8 64k;

    proxy_busy_buffers_size 128k;

    proxy_temp_file_write_size 128k;

    proxy_pass http://client_test;