微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Ceryx 动态反向代理

程序名称:Ceryx

授权协议: MIT

操作系统: Linux

开发语言: Python

Ceryx 介绍

Ceryx 是基于 Nginx OpenResty 的动态反向代理,带有一个
API。

代理

Ceryx 使用 Nginx OpenResty 为了基于请求主机进行路由请求。这个路由是使用 Nginx Lua 模块制作的,可以通过查询一个 Redis
后端获取结果。

API

Ceryx 包含一个简单 Flask Web 服务,支持路由的 REST 操作。用户可以使用一个 REST 客户端动态创建,更新和删除路由。

配置

Ceryx 支持使用环境变量配置,支持的配置选项:

  • CERYX_NAME: sets the API service name - defaults to ceryx

  • CERYX_DEBUG: enables debuging on the API service - defaults to true

  • CERYX_API_HOST: sets the host that the API will bind to - defaults to 127.0.0.1

  • CERYX_API_PORT: sets the port that the API will listen - defaults to 5555

  • CERYX_SERVER_NAME: the URL of the API service - default to None

  • CERYX_SECRET_KEY: the path of the secret key to use - defaults to None

  • CERYX_REdis_HOST: the redis host to connect to - defaults to 127.0.0.1

  • CERYX_REdis_PORT: the redis port to connect to - defaults to 6379

  • CERYX_REdis_PREFIX: the redis prefix to use in keys - defaults to ceryx

示例:

# production.yml
proxy:
  extends:
    file: base.yml
    service: proxy
  ports:
   - 80:80
  environment:
   - CERYX_REdis_HOST=my.redis.host
api:
  extends:
    file: base.yml
    service: api
  ports:
   - 5555:5555
  environment:
   - CERYX_REdis_HOST=my.redis.host
   - CERYX_DEBUG=false
   - CERYX_SECRET_KEY=/path/to/production/secret

Ceryx 官网

https://github.com/sourcelair/ceryx

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐