Skip to content

Instantly share code, notes, and snippets.

@mohak1712
Created March 28, 2020 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohak1712/3491e1935f44f3013f190ecb3aedb71c to your computer and use it in GitHub Desktop.
Save mohak1712/3491e1935f44f3013f190ecb3aedb71c to your computer and use it in GitHub Desktop.
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