Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions envoy/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ static_resources:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
Comment on lines +15 to +16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The typed_config body under the access logger uses 4-space indentation while every other typed_config block in this file uses 2-space indentation. While valid YAML, it's inconsistent and makes the file harder to read.

Suggested change
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

path: /dev/stdout
log_format:
json_format:
timestamp: "%START_TIME%"
method: "%REQ(:METHOD)%"
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
protocol: "%PROTOCOL%"
response_code: "%RESPONSE_CODE%"
grpc_status: "%GRPC_STATUS%"
content_type: "%REQ(content-type)%"
authority: "%REQ(:authority)%"
user_agent: "%REQ(user-agent)%"
x_forwarded_proto: "%REQ(x-forwarded-proto)%"
cf_ray: "%REQ(cf-ray)%"
cf_visitor: "%REQ(cf-visitor)%"
te: "%REQ(te)%"
upstream_host: "%UPSTREAM_HOST%"
upstream_cluster: "%UPSTREAM_CLUSTER%"
duration_ms: "%DURATION%"
stat_prefix: ingress_http
codec_type: AUTO
route_config:
Expand All @@ -35,6 +58,9 @@ static_resources:
cluster: http_backend
timeout: 60s
http_filters:
- name: envoy.filters.http.grpc_web
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
Comment on lines +61 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing CORS filter for browser gRPC-Web clients

The grpc_web filter is typically used to support browser-based gRPC-Web clients. If any browser connects to this endpoint cross-origin, the missing envoy.filters.http.cors filter will cause all preflight (OPTIONS) requests to fail with a CORS error before the grpc_web filter can handle them. The Envoy CORS filter must be placed before the grpc_web filter in the chain. If only server-side Node.js/native gRPC clients (like the @grpc/grpc-js-based SDK in scrawn.js) are used, this is not a concern.

- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
Expand Down
Loading