Skip to content

Instantly share code, notes, and snippets.

@msfidelis
Created December 2, 2019 13:28
Show Gist options
  • Save msfidelis/28ef26dbbd8761434a0c1413ccfbdcd8 to your computer and use it in GitHub Desktop.
Save msfidelis/28ef26dbbd8761434a0c1413ccfbdcd8 to your computer and use it in GitHub Desktop.
static_resources:
listeners:
# Declaração do Listener
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 8080 }
# Filtros HTTP
filter_chains:
- filters:
# Filtro HTTP
- name: envoy.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
stat_prefix: ingress_http
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
# Declaração de uma rota
routes:
- match: { prefix: "/" }
route: { host_rewrite: www.google.com, cluster: service_google }
http_filters:
- name: envoy.router
# Cluster / Backend
clusters:
- name: service_google
connect_timeout: 0.25s
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: service_google
endpoints:
- lb_endpoints:
- endpoint:
address:
# Endereço do Backend
socket_address:
address: www.google.com
port_value: 443
# Resolução do sni para troca do certificado
tls_context:
sni: www.google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment