Created
March 28, 2020 13:32
-
-
Save mohak1712/3491e1935f44f3013f190ecb3aedb71c to your computer and use it in GitHub Desktop.
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
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } | |
static_resources: | |
listeners: | |
- name: listener_0 | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 80 } | |
filter_chains: | |
- filters: | |
- name: envoy.http_connection_manager | |
config: | |
codec_type: auto | |
stat_prefix: ingress_http | |
route_config: | |
name: local_route | |
virtual_hosts: | |
- name: local_service | |
domains: ["*"] | |
routes: | |
- match: { prefix: "/ping" } | |
route: | |
cluster: ping_pong_service | |
http_filters: | |
- name: envoy.lua | |
config: | |
inline_code: | | |
function envoy_on_request(req) | |
headers = req:headers() | |
auth_header = headers:get("Authorization") | |
if (auth_header==nil or auth_header=='') then | |
req:respond({[":status"] = "401"}, "") | |
end | |
end | |
- name: envoy.router | |
clusters: | |
- name: ping_pong_service | |
connect_timeout: 0.25s | |
type: logical_dns | |
lb_policy: round_robin | |
hosts: [{ socket_address: { address: host.docker.internal, port_value: 8080 }}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment