diff --git a/build/rpc.json b/build/rpc.json index 37026d1..5bb6a14 100644 --- a/build/rpc.json +++ b/build/rpc.json @@ -22464,7 +22464,7 @@ }, { "name": "UpdateReverseProxyRequest", - "code": "message UpdateReverseProxyRequest {\n\tint64 reverseProxyId = 1;\n\tint32 requestHostType = 6;\n\tstring requestHost = 2;\n\tbool requestHostExcludingPort = 15;\n\tstring requestURI = 3;\n\tstring stripPrefix = 4;\n\tbool autoFlush = 5;\n\trepeated string addHeaders = 7;\n\tbytes connTimeoutJSON = 8;\n\tbytes readTimeoutJSON = 9;\n\tbytes idleTimeoutJSON = 10;\n\tint32 maxConns = 11;\n\tint32 maxIdleConns = 12;\n\tbytes proxyProtocolJSON = 13;\n\tbool followRedirects = 14;\n}", + "code": "message UpdateReverseProxyRequest {\n\tint64 reverseProxyId = 1; // 反向代理ID\n\tint32 requestHostType = 6; // 可选参数,回源主机名类型:0 跟随CDN域名,1跟随源站,2自定义\n\tstring requestHost = 2; // 可选参数,自定义回源主机名\n\tbool requestHostExcludingPort = 15; // 可选参数,回源主机名中去除端口\n\tstring requestURI = 3; // 可选参数,请求URI\n\tstring stripPrefix = 4; // 可选参数,去除URI前缀\n\tbool autoFlush = 5; // 可选参数,自动刷新\n\trepeated string addHeaders = 7; // 可选参数,可以添加的请求报头\n\tbytes connTimeoutJSON = 8; // 可选参数,连接超时时间\n\tbytes readTimeoutJSON = 9; // 可选参数,读取超时时间\n\tbytes idleTimeoutJSON = 10; // 可选参数,空闲连接超时时间\n\tint32 maxConns = 11; // 可选参数,最大连接数\n\tint32 maxIdleConns = 12; // 可选参数,最大空闲连接数\n\tbytes proxyProtocolJSON = 13; // 可选参数,PROXY Protocol设置\n\tbool followRedirects = 14; // 可选参数,跳转跟随\n\tbool retry50X = 16; // 可选参数,启用50X重试\n}", "doc": "修改反向代理设置" }, { diff --git a/pkg/rpc/pb/service_reverse_proxy.pb.go b/pkg/rpc/pb/service_reverse_proxy.pb.go index baebb0a..3133326 100644 --- a/pkg/rpc/pb/service_reverse_proxy.pb.go +++ b/pkg/rpc/pb/service_reverse_proxy.pb.go @@ -495,21 +495,22 @@ type UpdateReverseProxyRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ReverseProxyId int64 `protobuf:"varint,1,opt,name=reverseProxyId,proto3" json:"reverseProxyId,omitempty"` - RequestHostType int32 `protobuf:"varint,6,opt,name=requestHostType,proto3" json:"requestHostType,omitempty"` - RequestHost string `protobuf:"bytes,2,opt,name=requestHost,proto3" json:"requestHost,omitempty"` - RequestHostExcludingPort bool `protobuf:"varint,15,opt,name=requestHostExcludingPort,proto3" json:"requestHostExcludingPort,omitempty"` - RequestURI string `protobuf:"bytes,3,opt,name=requestURI,proto3" json:"requestURI,omitempty"` - StripPrefix string `protobuf:"bytes,4,opt,name=stripPrefix,proto3" json:"stripPrefix,omitempty"` - AutoFlush bool `protobuf:"varint,5,opt,name=autoFlush,proto3" json:"autoFlush,omitempty"` - AddHeaders []string `protobuf:"bytes,7,rep,name=addHeaders,proto3" json:"addHeaders,omitempty"` - ConnTimeoutJSON []byte `protobuf:"bytes,8,opt,name=connTimeoutJSON,proto3" json:"connTimeoutJSON,omitempty"` - ReadTimeoutJSON []byte `protobuf:"bytes,9,opt,name=readTimeoutJSON,proto3" json:"readTimeoutJSON,omitempty"` - IdleTimeoutJSON []byte `protobuf:"bytes,10,opt,name=idleTimeoutJSON,proto3" json:"idleTimeoutJSON,omitempty"` - MaxConns int32 `protobuf:"varint,11,opt,name=maxConns,proto3" json:"maxConns,omitempty"` - MaxIdleConns int32 `protobuf:"varint,12,opt,name=maxIdleConns,proto3" json:"maxIdleConns,omitempty"` - ProxyProtocolJSON []byte `protobuf:"bytes,13,opt,name=proxyProtocolJSON,proto3" json:"proxyProtocolJSON,omitempty"` - FollowRedirects bool `protobuf:"varint,14,opt,name=followRedirects,proto3" json:"followRedirects,omitempty"` + ReverseProxyId int64 `protobuf:"varint,1,opt,name=reverseProxyId,proto3" json:"reverseProxyId,omitempty"` // 反向代理ID + RequestHostType int32 `protobuf:"varint,6,opt,name=requestHostType,proto3" json:"requestHostType,omitempty"` // 可选参数,回源主机名类型:0 跟随CDN域名,1跟随源站,2自定义 + RequestHost string `protobuf:"bytes,2,opt,name=requestHost,proto3" json:"requestHost,omitempty"` // 可选参数,自定义回源主机名 + RequestHostExcludingPort bool `protobuf:"varint,15,opt,name=requestHostExcludingPort,proto3" json:"requestHostExcludingPort,omitempty"` // 可选参数,回源主机名中去除端口 + RequestURI string `protobuf:"bytes,3,opt,name=requestURI,proto3" json:"requestURI,omitempty"` // 可选参数,请求URI + StripPrefix string `protobuf:"bytes,4,opt,name=stripPrefix,proto3" json:"stripPrefix,omitempty"` // 可选参数,去除URI前缀 + AutoFlush bool `protobuf:"varint,5,opt,name=autoFlush,proto3" json:"autoFlush,omitempty"` // 可选参数,自动刷新 + AddHeaders []string `protobuf:"bytes,7,rep,name=addHeaders,proto3" json:"addHeaders,omitempty"` // 可选参数,可以添加的请求报头 + ConnTimeoutJSON []byte `protobuf:"bytes,8,opt,name=connTimeoutJSON,proto3" json:"connTimeoutJSON,omitempty"` // 可选参数,连接超时时间 + ReadTimeoutJSON []byte `protobuf:"bytes,9,opt,name=readTimeoutJSON,proto3" json:"readTimeoutJSON,omitempty"` // 可选参数,读取超时时间 + IdleTimeoutJSON []byte `protobuf:"bytes,10,opt,name=idleTimeoutJSON,proto3" json:"idleTimeoutJSON,omitempty"` // 可选参数,空闲连接超时时间 + MaxConns int32 `protobuf:"varint,11,opt,name=maxConns,proto3" json:"maxConns,omitempty"` // 可选参数,最大连接数 + MaxIdleConns int32 `protobuf:"varint,12,opt,name=maxIdleConns,proto3" json:"maxIdleConns,omitempty"` // 可选参数,最大空闲连接数 + ProxyProtocolJSON []byte `protobuf:"bytes,13,opt,name=proxyProtocolJSON,proto3" json:"proxyProtocolJSON,omitempty"` // 可选参数,PROXY Protocol设置 + FollowRedirects bool `protobuf:"varint,14,opt,name=followRedirects,proto3" json:"followRedirects,omitempty"` // 可选参数,跳转跟随 + Retry50X bool `protobuf:"varint,16,opt,name=retry50X,proto3" json:"retry50X,omitempty"` // 可选参数,启用50X重试 } func (x *UpdateReverseProxyRequest) Reset() { @@ -649,6 +650,13 @@ func (x *UpdateReverseProxyRequest) GetFollowRedirects() bool { return false } +func (x *UpdateReverseProxyRequest) GetRetry50X() bool { + if x != nil { + return x.Retry50X + } + return false +} + var File_service_reverse_proxy_proto protoreflect.FileDescriptor var file_service_reverse_proxy_proto_rawDesc = []byte{ @@ -715,7 +723,7 @@ var file_service_reverse_proxy_proto_rawDesc = []byte{ 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x4a, 0x53, 0x4f, 0x4e, - 0x22, 0xe1, 0x04, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, + 0x22, 0xfd, 0x04, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, @@ -753,50 +761,52 @@ var file_service_reverse_proxy_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x64, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x73, 0x32, 0xa2, 0x05, 0x0a, 0x13, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x12, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x62, 0x0a, 0x17, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x22, 0x2e, 0x70, + 0x65, 0x63, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x74, 0x72, 0x79, 0x35, 0x30, 0x58, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x74, 0x72, 0x79, 0x35, 0x30, 0x58, + 0x32, 0xa2, 0x05, 0x0a, 0x13, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1d, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, + 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, + 0x17, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, + 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x1d, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x1c, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x5f, 0x0a, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, - 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, + 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x74, 0x0a, 0x1d, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x76, + 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x1c, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x5f, 0x0a, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, + 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x5d, 0x0a, 0x1f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, + 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, + 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5d, 0x0a, 0x1f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/protos/service_reverse_proxy.proto b/pkg/rpc/protos/service_reverse_proxy.proto index 1944dd3..c2fa737 100644 --- a/pkg/rpc/protos/service_reverse_proxy.proto +++ b/pkg/rpc/protos/service_reverse_proxy.proto @@ -79,19 +79,20 @@ message UpdateReverseProxyBackupOriginsRequest { // 修改反向代理设置 message UpdateReverseProxyRequest { - int64 reverseProxyId = 1; - int32 requestHostType = 6; - string requestHost = 2; - bool requestHostExcludingPort = 15; - string requestURI = 3; - string stripPrefix = 4; - bool autoFlush = 5; - repeated string addHeaders = 7; - bytes connTimeoutJSON = 8; - bytes readTimeoutJSON = 9; - bytes idleTimeoutJSON = 10; - int32 maxConns = 11; - int32 maxIdleConns = 12; - bytes proxyProtocolJSON = 13; - bool followRedirects = 14; + int64 reverseProxyId = 1; // 反向代理ID + int32 requestHostType = 6; // 可选参数,回源主机名类型:0 跟随CDN域名,1跟随源站,2自定义 + string requestHost = 2; // 可选参数,自定义回源主机名 + bool requestHostExcludingPort = 15; // 可选参数,回源主机名中去除端口 + string requestURI = 3; // 可选参数,请求URI + string stripPrefix = 4; // 可选参数,去除URI前缀 + bool autoFlush = 5; // 可选参数,自动刷新 + repeated string addHeaders = 7; // 可选参数,可以添加的请求报头 + bytes connTimeoutJSON = 8; // 可选参数,连接超时时间 + bytes readTimeoutJSON = 9; // 可选参数,读取超时时间 + bytes idleTimeoutJSON = 10; // 可选参数,空闲连接超时时间 + int32 maxConns = 11; // 可选参数,最大连接数 + int32 maxIdleConns = 12; // 可选参数,最大空闲连接数 + bytes proxyProtocolJSON = 13; // 可选参数,PROXY Protocol设置 + bool followRedirects = 14; // 可选参数,跳转跟随 + bool retry50X = 16; // 可选参数,启用50X重试 } \ No newline at end of file diff --git a/pkg/serverconfigs/reverse_proxy_config.go b/pkg/serverconfigs/reverse_proxy_config.go index 5f78a2a..34a157e 100644 --- a/pkg/serverconfigs/reverse_proxy_config.go +++ b/pkg/serverconfigs/reverse_proxy_config.go @@ -16,6 +16,12 @@ const ( RequestHostTypeCustomized RequestHostType = 2 ) +func NewReverseProxyConfig() *ReverseProxyConfig { + return &ReverseProxyConfig{ + Retry50X: true, + } +} + // ReverseProxyConfig 反向代理设置 type ReverseProxyConfig struct { Id int64 `yaml:"id" json:"id"` // ID @@ -38,6 +44,7 @@ type ReverseProxyConfig struct { RequestHost string `yaml:"requestHost" json:"requestHost"` // 请求Host,支持变量 RequestURI string `yaml:"requestURI" json:"requestURI"` // 请求URI,支持变量,如果同时定义了StripPrefix,则先执行StripPrefix RequestHostExcludingPort bool `yaml:"requestHostExcludingPort" json:"requestHostExcludingPort"` // 请求Host不包括端口 + Retry50X bool `yaml:"retry50X" json:"retry50X"` // 50x 错误重试 AddHeaders []string `yaml:"addHeaders" json:"addHeaders"` // 自动添加的Header