Git Product home page Git Product logo

resty-marathon-lb's Introduction

resty-marathon-lb

这是啥玩意

这是一个 LeanCloud 维护的基于 OpenResty 的服务发现路由。 在 nginx 配置里说明要 proxy_pass 的 Marathon 应用,就可以直接路由过去了。

server {
    listen 80;
    server_name example.com;
    location / {
        dyups_interface;
        # "marathon-rest-api地址#应用id:应用端口"
        set $marathon_app "marathon:8080#your-awesome-app:4000";
        set $upstream "";
        access_by_lua_file "lua/marathon-app.lua";
        proxy_pass http://$upstream;
    }
}
$ curl http://example.com/ping
This is your awesome app serving at port 23745 (a Mesos allocated port)

怎么用

看看 nginx.confcomponents.conf。 通过 build.sh 可以构建出一个 docker 镜像,用这个部署就可以了。 可以直接用 --net=host 来部署,会暴露4个端口:

  • 80 HTTP
  • 880 接受 Proxy Protocol 的 HTTP
  • 443 HTTPS
  • 8443 接受 Proxy Protocol 的 HTTPS

License

MIT

resty-marathon-lb's People

Contributors

feisuzhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.