resources: - "@type": type.googleapis.com/envoy.config.listener.v3.Listener name: listener_web address: socket_address: {address: 0.0.0.0, port_value: 80} filter_chains: - filters: - name: envoy.filters.network.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager stat_prefix: ingress_http codec_type: AUTO generate_request_id: true always_set_request_id_in_response: true stream_error_on_invalid_http_message: true # use_remote_address: true normalize_path: true merge_slashes: true path_with_escaped_slashes_action: UNESCAPE_AND_REDIRECT common_http_protocol_options: idle_timeout: 3600s # 1 hour # headers_with_underscores_action: REJECT_REQUEST http2_protocol_options: max_concurrent_streams: 100 initial_stream_window_size: 65536 # 64 KiB initial_connection_window_size: 1048576 # 1 MiB stream_idle_timeout: 30s # 5 mins, must be disabled for long-lived and streaming requests request_timeout: 30s # 5 mins, must be disabled for long-lived and streaming requests request_headers_timeout: 30s drain_timeout: 30s delayed_close_timeout: 30s access_log: - name: "envoy.access_loggers.stdout" typed_config: "@type": "type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog" log_format: json_format: "@timestamp": "%START_TIME%" client.address: "%DOWNSTREAM_REMOTE_ADDRESS%" client.local.address: "%DOWNSTREAM_LOCAL_ADDRESS%" envoy.route.name: "%ROUTE_NAME%" envoy.upstream.cluster: "%UPSTREAM_CLUSTER%" host.hostname: "%HOSTNAME%" http.request.body.bytes: "%BYTES_RECEIVED%" http.request.duration: "%DURATION%" http.request.headers.accept: "%REQ(ACCEPT)%" http.request.headers.authority: "%REQ(:AUTHORITY)%" http.request.headers.id: "%REQ(X-REQUEST-ID)%" http.request.headers.x_forwarded_for: "%REQ(X-FORWARDED-FOR)%" http.request.headers.x_forwarded_proto: "%REQ(X-FORWARDED-PROTO)%" http.request.path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" http.request.start_time: "%START_TIME%" http.request.protocol: "%PROTOCOL%" http.request.method: "%REQ(:METHOD)%" http.response.body.bytes: "%BYTES_SENT%" http.response.response_code: "%RESPONSE_CODE%" http.response.response_flag: "%RESPONSE_FLAGS%" service.name: "envoy" service.version: "1.28" http.request.headers.traceparent: "%REQ(TRACEPARENT)%" x-request-id: "%REQ(X-REQUEST-ID)%" route_config: name: api_service_route_config virtual_hosts: - name: api_service_route domains: ["*"] routes: - match: {prefix: "/edugo.api.services.sms.v1.SmsApiService/SendSmsExternalGETV1", grpc: {}} # grpc:{} means that requests are only forwarded if they are found in the grpc service definition, returning 404 for others route: {cluster: new_api_grpc_cluster, timeout: 60s} http_filters: - name: envoy.filters.http.grpc_json_transcoder typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder proto_descriptor: "/var/lib/envoy/descriptors.binp" services: ["edugo.api.services.sms.v1.SmsApiService"] convert_grpc_status: true auto_mapping: true print_options: add_whitespace: true always_print_primitive_fields: true always_print_enums_as_ints: false preserve_proto_field_names: false - name: envoy.filters.http.ext_authz typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz grpc_service: envoy_grpc: cluster_name: ext-service_authz_cluster timeout: 5s transport_api_version: V3 failure_mode_allow: false with_request_body: max_request_bytes: 819200 allow_partial_message: true pack_as_bytes: true status_on_error: code: 503 encode_raw_headers: false stat_prefix: ext_authz - name: envoy.filters.http.lua typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua default_source_code: inline_string: "-- Called on the request path.\nfunction envoy_on_request(request_handle)\n local meta = request_handle:streamInfo():dynamicMetadata():get(\"envoy.filters.http.ext_authz\")\n local orgId = meta[\"x-edu-org-id\"]\n local uri = request_handle:headers():get(\":path\")\n request_handle:logCritical(\" request: \"..uri)\n request_handle:logCritical(\" orgId: \"..orgId)\nend\n\nfunction envoy_on_response(response_handle)\n response_handle:logCritical(\"Before reading response body\")\n local bufferResp = response_handle:body()\n response_handle:logCritical(\"After reading response body\") \nend\n" - name: envoy.filters.http.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router