Ceryx動態(tài)反向代理
Ceryx 是基于 NGINX OpenResty 的動態(tài)反向代理,帶有一個 API。
代理
Ceryx 使用 NGINX OpenResty 為了基于請求主機進行路由請求。這個路由是使用 NGINX Lua 模塊制作的,可以通過查詢一個 Redis 后端獲取結(jié)果。
API
Ceryx 包含一個簡單 Flask Web 服務,支持路由的 REST 操作。用戶可以使用一個 REST 客戶端動態(tài)創(chuàng)建,更新和刪除路由。
配置
Ceryx 支持使用環(huán)境變量配置,支持的配置選項:
CERYX_NAME: sets the API service name - defaults to ceryxCERYX_DEBUG: enables debuging on the API service - defaults to trueCERYX_API_HOST: sets the host that the API will bind to - defaults to 127.0.0.1CERYX_API_PORT: sets the port that the API will listen - defaults to 5555CERYX_SERVER_NAME: the URL of the API service - default to NoneCERYX_SECRET_KEY: the path of the secret key to use - defaults to NoneCERYX_REDIS_HOST: the redis host to connect to - defaults to 127.0.0.1CERYX_REDIS_PORT: the redis port to connect to - defaults to 6379CERYX_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
