Coder Social home page Coder Social logo

gateway-ngxcfg's Introduction

#gateway-ngxcfg

##目的

使用nginx作为反向代理的后端服务器,只能通过手动进行扩缩,无法动态扩缩。为了解决这个问题,可以采用

  • LUA脚本
  • 采用nginx plus

但是这两个要求对于我来说,都不可行,所以只能自造轮子。该轮子主要是为了解决项目gateway-dubbox的负载均衡及动态扩缩问题。

##设计思路

设计思路主要参考 http://blog.csdn.net/akin_zhou/article/details/50373414

  1. 从注册中心zookeeper拉取相应的服务列表; 从注册中心拉取相应的服务列表,主要是为了获取nginx的配置信息需要服务地址及端口相应的信息。

  2. 生成nginx的配置文件; 生成nginx的配置信息,主要分为两部分

    • upstream部分

    • location部分

    • 这两部分以include的形式引入nginx的主配置文件

  3. 调用shell脚本,nginx重新加载配置文件

gateway-ngxcfg's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.