@ -3,8 +3,10 @@ syntax = "proto3";
package envoy . extensions . filters.network.http_connection_manager.v4alpha ;
import "envoy/config/accesslog/v4alpha/accesslog.proto" ;
import "envoy/config/core/v4alpha/base.proto" ;
import "envoy/config/core/v4alpha/config_source.proto" ;
import "envoy/config/core/v4alpha/protocol.proto" ;
import "envoy/config/core/v4alpha/substitution_format_string.proto" ;
import "envoy/config/route/v4alpha/route.proto" ;
import "envoy/config/route/v4alpha/scoped_route.proto" ;
import "envoy/config/trace/v4alpha/http_tracer.proto" ;
@ -507,6 +509,11 @@ message HttpConnectionManager {
/ / 3. Tracing decision ( sampled , forced , etc ) is set in 14 th byte of the UUID.
RequestIDExtension request_id_extension = 36 ;
/ / The configuration to customize local reply returned by Envoy. It can customize status code ,
/ / body text and response content type. If not specified , status code and text body are hard
/ / coded in Envoy , the response content type is plain text.
LocalReplyConfig local_reply_config = 38 ;
/ / Determines if the port part should be removed from host / authority header before any processing
/ / of request by HTTP filters or routing. The port would be removed only if it is equal to the : ref : ` listener ' s < envoy_api_field_config.listener.v4alpha.Listener.address > `
/ / local port and request method is not CONNECT. This affects the upstream host header as well.
@ -516,6 +523,74 @@ message HttpConnectionManager {
bool strip_matching_host_port = 39 ;
}
/ / The configuration to customize local reply returned by Envoy.
message LocalReplyConfig {
option ( udpa.annotations.versioning ) . previous_message_type =
"envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig" ;
/ / Configuration of list of mappers which allows to filter and change local response.
/ / The mappers will be checked by the specified order until one is matched.
repeated ResponseMapper mappers = 1 ;
/ / The configuration to form response body from the : ref : ` command operators < config_access_log_command_operators > `
/ / and to specify response content type as one of : plain / text or application / json.
/ /
/ / Example one : plain / text body_format.
/ /
/ / . . code - block : :
/ /
/ / text_format : % LOCAL_REPLY_BODY % : % RESPONSE_CODE % : path = $ REQ ( : path ) %
/ /
/ / The following response body in ` plain / text ` format will be generated for a request with
/ / local reply body of "upstream connection error" , response_code = 503 and path = / foo.
/ /
/ / . . code - block : :
/ /
/ / upstream connect error : 503 : path = / foo
/ /
/ / Example two : application / json body_format.
/ /
/ / . . code - block : :
/ /
/ / json_format :
/ / status : % RESPONSE_CODE %
/ / message : % LOCAL_REPLY_BODY %
/ / path : $ REQ ( : path ) %
/ /
/ / The following response body in "application/json" format would be generated for a request with
/ / local reply body of "upstream connection error" , response_code = 503 and path = / foo.
/ /
/ / . . code - block : : json
/ /
/ / {
/ / "status" : 503 ,
/ / "message" : "upstream connection error" ,
/ / "path" : "/foo"
/ / }
/ /
config.core.v4alpha.SubstitutionFormatString body_format = 2 ;
}
/ / The configuration to filter and change local response.
message ResponseMapper {
option ( udpa.annotations.versioning ) . previous_message_type =
"envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper" ;
/ / Filter to determine if this mapper should apply.
config.accesslog.v4alpha.AccessLogFilter filter = 1 [ ( validate.rules ) . message = { required : true } ] ;
/ / The new response status code if specified.
google.protobuf.UInt32Value status_code = 2 [ ( validate.rules ) . uint32 = { lt : 600 gte : 200 } ] ;
/ / The new local reply body text if specified. It will be used in the ` % LOCAL_REPLY_BODY % `
/ / command operator in the ` body_foramt ` .
config.core.v4alpha.DataSource body = 3 ;
/ / A per mapper ` body_format ` to override the : ref : ` body_format < envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.LocalReplyConfig.body_format > ` .
/ / It will be used when this mapper is matched.
config.core.v4alpha.SubstitutionFormatString body_format_override = 4 ;
}
message Rds {
option ( udpa.annotations.versioning ) . previous_message_type =
"envoy.extensions.filters.network.http_connection_manager.v3.Rds" ;