nginx 根据IP 进行灰度发布
生活随笔
收集整理的這篇文章主要介紹了
nginx 根据IP 进行灰度发布
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://purplegrape.blog.51cto.com/1330104/1403123
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | upstream prod { ????server 192.168.1.10; ????server 192.168.1.11; } upstream pre-prod { ????server 192.168.1.100; } server { ????listen 80; ????access_log?/var/log/nginx/access.log main; ????set?$web_backend prod; ????if?($remote_addr ~?"123.123.123.123") { ????????set?$web_backend pre-prod; ????} ????location / { ????????proxy_pass http://$web_backend; ????????include proxy.conf; ????} } |
| 1 2 3 4 5 6 7 8 9 10 11 | server { ????listen 80; ????access_log?/var/log/nginx/access.log main; ????set?$rootdir?"/var/www/html"; ????if?($remote_addr ~?"123.123.123.123") { ????????set?$rootdir?"/var/www/test"; ????} ????location / { ????????root $rootdir; ????} } |
============http://kevinpeng.iteye.com/blog/1042430
http://blog.chinaunix.net/uid-531464-id-4140473.html
總結
以上是生活随笔為你收集整理的nginx 根据IP 进行灰度发布的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 最全面 Nginx 入门教程 + 常用配
- 下一篇: 解决The current branch