Created
December 19, 2018 04:10
-
-
Save didierofrivia/de9701158b2cfddca938fd0d9c29bc91 to your computer and use it in GitHub Desktop.
apicast standalone config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"global": { | |
"log_level": "debug", | |
"error_log": "stderr", | |
"access_log": "stdout", | |
"opentracing_tracer": "jaeger", | |
"upstream": { | |
"load_balancer": "least_conn", | |
"retry": "5xx", | |
"retry_times": 3 | |
} | |
}, | |
"server": { | |
"listen": [ | |
{ | |
"port": 8090, | |
"name": "management" | |
}, | |
{ | |
"port": 8081, | |
"name": "echo" | |
}, | |
{ | |
"port": 8080, | |
"name": "default" | |
}, | |
{ | |
"port": 8089, | |
"name": "default", | |
"proxy_protocol": true | |
}, | |
{ | |
"port": 8443, | |
"protocol": "http2", | |
"tls": true | |
}, | |
{ | |
"port": 8444, | |
"name": "default", | |
"protocol": "http2", | |
"proxy_protocol": true, | |
"tls": { | |
"protocols": "TLSv1.3", | |
"certificate": "/var/run/secret/apicast/certificate.crt", | |
"certificate_key": "/var/run/secret/apicast/certificate.key", | |
"ciphers": "HIGH:!aNULL:!MD5" | |
} | |
}, | |
{ | |
"port": 9421, | |
"name": "prometheus" | |
} | |
], | |
"tls": { | |
"protocols": "TLSv1.3", | |
"certificate": "/var/run/secret/apicast/certificate.crt", | |
"certificate_key": "/var/run/secret/apicast/certificate.key", | |
"ciphers": "HIGH:!aNULL:!MD5" | |
} | |
}, | |
"routes": [ | |
{ | |
"name": "management", | |
"match": { | |
"server_port": "management" | |
}, | |
"destination": { | |
"service": "management", | |
"policy_chain": "management", | |
"upstream": "management" | |
} | |
}, | |
{ | |
"name": "echo", | |
"match": { | |
"server_port": "echo" | |
}, | |
"destination": { | |
"service": "echo" | |
} | |
}, | |
{ | |
"match": { | |
"server_port": "prometheus" | |
}, | |
"routes": [ | |
{ | |
"match": { | |
"uri_path": "/metrics", | |
"http_method": "GET" | |
}, | |
"destination": { | |
"service": "prometheus" | |
} | |
}, | |
{ | |
"match": { | |
"http_method": "POST" | |
}, | |
"destination": { | |
"http_response": 405 | |
} | |
} | |
], | |
"destination": { | |
"service": "not_found" | |
} | |
}, | |
{ | |
"match": { | |
"http_host": "auth.example.com" | |
}, | |
"destination": { | |
"service": "auth-server" | |
} | |
}, | |
{ | |
"match": { | |
"server_port": "default" | |
}, | |
"destination": { | |
"service": "3scale" | |
} | |
}, | |
{ | |
"match": { | |
"always": true | |
}, | |
"destination": { | |
"service": "not_found" | |
} | |
} | |
], | |
"internal": [ | |
{ | |
"name": "auth-server", | |
"policy_chain": [ | |
{ | |
"policy": "example.authentication.server", | |
"configuration": { | |
"redis": "external://redis" | |
} | |
} | |
] | |
}, | |
{ | |
"name": "3scale", | |
"policy_chain": [ | |
{ | |
"policy": "apicast.policy.load_configuration" | |
}, | |
{ | |
"policy": "apicast.policy.find_service" | |
}, | |
{ | |
"policy": "apicast.policy.local_chain" | |
} | |
] | |
}, | |
{ | |
"name": "simple", | |
"policy_chain": [ | |
{ | |
"policy": "example.authentication.client", | |
"configuration": { | |
"server": "internal://auth-server" | |
} | |
} | |
], | |
"upstream": "http://echo-api.3scale.net" | |
}, | |
{ | |
"name": "echo", | |
"policy_chain": [ | |
"logging" | |
], | |
"upstream": "external://echo" | |
}, | |
{ | |
"name": "backend", | |
"policy_chain": [ | |
"echo" | |
] | |
}, | |
{ | |
"name": "management", | |
"policy_chain": [ | |
{ | |
"policy": "apicast.policy.management", | |
"configuration": { | |
"mode": "debug" | |
} | |
} | |
] | |
}, | |
{ | |
"name": "prometheus", | |
"policy_chain": [ | |
{ | |
"policy": "apicast.policy.prometheus" | |
} | |
] | |
}, | |
{ | |
"name": "echo", | |
"policy_chain": [ | |
{ | |
"policy": "apicast.policy.cors", | |
"configuration": { | |
"allow_methods": "GET", | |
"allow_origin": "*" | |
} | |
}, | |
{ | |
"policy": "apicast.policy.echo" | |
} | |
] | |
}, | |
{ | |
"name": "logging", | |
"policy_chain": [ | |
{ | |
"policy": "log", | |
"configuration": { | |
"url": "syslog://localhost", | |
"fields": "url, path, client_ip" | |
} | |
} | |
] | |
} | |
], | |
"external": [ | |
{ | |
"name": "backend", | |
"server": "https://su1.3scale.net", | |
"load_balancer": "least_conn" | |
}, | |
{ | |
"name": "echo", | |
"server": "https://echo-api.3scale.net", | |
"load_balancer": "least_conn" | |
}, | |
{ | |
"name": "redis", | |
"server": "tcp://localhost:6879", | |
"load_balancer": "least_conn" | |
} | |
], | |
"retries": 3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment