readme.md 1.47 KB

java nginx 配置文件

说明

这些文件需要copyopenrestyhome 目录

动态upstream的支持

基于 lua-upstream-nginx-module 动态设置upstream的 up, down

  1. 查询所有的upstreams信息:

curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=list&upstream=ufogateway"

  1. 设置 upstream 名称为 ufogatewayupstream 第0个 backend server 状态为down

curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=down&upstream=ufogateway&id=0"

  1. 设置upstream 名称为 ufogatewayupstream 第0个 backend server 状态为up:

curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=up&upstream=ufogateway&id=0"

list 接口响应:


{
    "name": "ufogateway", 
    "value": [
        {
            "backup": false, 
            "name": "172.31.70.77:8080", 
            "down": false, 
            "id": 0
        }, 
        {
            "backup": false, 
            "name": "172.31.70.113:8080", 
            "down": false, 
            "id": 1
        }, 
        {
            "backup": false, 
            "name": "172.31.70.8:8080", 
            "down": false, 
            "id": 2
        }, 
        {
            "backup": false, 
            "name": "172.31.70.104:8080", 
            "down": false, 
            "id": 3
        }
    ]
}