如何解决无法通过 Envoy (v1.17.0) 将 API 调用转发到各自在 docker-compose (v1.27.4) 中的路由
tl;dnr
我无法让我的 docker-compose Envoy API 网关正确转发到引用的服务。
“转发的路由”总是以错误告终:
upstream connect error or disconnect/reset before headers. reset reason: connection termination
我一定是搞砸了一些简单的事情,因为这很难解决。任何额外的帮助将不胜感激。
为篇幅和细节道歉!
大家好,这是我第一次尝试使用 Envoy 作为我的 API 网关,并且似乎无法克服上述错误。基本上,我有两个 .Net 5 服务、标签和文档,它们位于单独的 docker 容器中,它们的端口是公开的。我想使用 Envoy 作为一个简单的 API 网关(还没有 https),只是为了根据简单的路由匹配将流量重定向到适当的服务。
现在,我一直在使用许多在线示例作为实验的基础,所以我不得不在某处出错。任何方向指向将不胜感激。我已验证以下所有内容:
- 我可以使用“http://localhost:[portid]”和“http://host.docker.internal:[portid]”直接从我的桌面访问我的网络服务
- 从 envoy docker cli 实例,我可以正确解析服务的内部 IP (docker-compose) 地址。
- 从 envoy docker cli 实例,我可以
curl http://localapp-tags/api/Cats
成功。 - 在外部,我可以导航到“http://host.docker.internal:10000”并查看 Envoy 主页。
- 无论我做什么,我都无法使用例如“http://localhost:10080/t/api/Cats”从外部重定向到我的服务。 (下面的跟踪转储)
我用作参考或在本地运行以将我的应用程序的配置文件[s] 基于的站点:
- 特使文档,Static Configuration w/ the Default demo file
- 特使文档,Front Proxy 和 Blog Post
- 用作指南的参考架构,.Net eShopOnContainers
- Hosting Reference
- 教程,Build an API Gateway with Envoy and use with .NET Core APIs(很好的资源>)
在谷歌搜索数小时后(要列出太多网站/链接),最具体的建议是将 connection_timeout
从 0.25 秒增加到 30 秒,这对我没有任何影响。因此,虽然我知道似乎有答案(这可能是重复的),但实际上没有其他方法可以解决问题:(
我还尝试在 docker-compose 中创建一个命名网络(例如 Front-Proxy 示例,但这也不起作用!)
同样,如果您有任何其他建议,我们将不胜感激。
如您所见,在我想出自己的 docker-compose 和 envoy 配置文件之前,我经历了许多教程和小步骤。
docker-compose.yaml(为了简洁起见省略了一些部分,也忽略了拼写错误,因为我进行了搜索和替换,可能遗漏了一些东西)
# Edge/Api Gateway localapp-gw: image: ${REGISTRY:}/localapp.apigw:${PLATFORM:-linux}-${TAG:-latest} build: context: ./server-conf/envoy ports: - "9901:9901" - "10000:10000" - "10001:10001" - "10080:10080" - "10443:10443" volumes: - ./server-conf/envoy/envoy.yaml:/etc/envoy/envoy.yaml # Backend APIS localapp-tags: image: ${REGISTRY:}/localapp.tags:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: code/Services/Tag/localapp.tags/Dockerfile environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://+:80; - GRPC_PORT=81 - PORT=80 ports: - "32080:80" - "32081:81" - "32443:443" volumes: - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro - ${USERPROFILE}/.aspnet/https:/root/.aspnet/https:ro localapp-docs: image: ${REGISTRY:}/localapp.docs:${PLATFORM:-linux}-${TAG:-latest} build: context: . dockerfile: code/Services/Document/localapp.docs/Dockerfile environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://+:80; - GRPC_PORT=81 - PORT=80 ports: - "36080:80" - "36081:81" - "36443:443" volumes: - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro - ${USERPROFILE}/.aspnet/https:/root/.aspnet/https:ro
envoy.yaml
admin: access_log_path: /tmp/admin_access.log address: socket_address: address: 0.0.0.0 port_value: 9901 static_resources: listeners: - name: listener_0 address: socket_address: address: 0.0.0.0 port_value: 10000 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 access_log: - name: envoy.access_loggers.file typed_config: "@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog path: /tmp/stdout http_filters: - name: envoy.filters.http.router route_config: name: local_route virtual_hosts: - name: local_service domains: ["*"] routes: - match: prefix: "/" route: host_rewrite_literal: www.envoyproxy.io cluster: service_envoyproxy_io - name: listener_10080 address: socket_address: address: 0.0.0.0 port_value: 10080 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 codec_type: auto stat_prefix: ingress_http route_config: name: onecore_route virtual_hosts: - name: localapp_services domains: ["*"] routes: - match: { prefix: "/t/" } route: cluster: tags_service auto_host_rewrite: true idle_timeout: 10s - match: { prefix: "/d/" } route: cluster: docs_service auto_host_rewrite: true idle_timeout: 10s http_filters: - name: envoy.filters.http.router typed_config: {} clusters: - name: service_envoyproxy_io connect_timeout: 30s type: LOGICAL_DNS dns_lookup_family: V4_ONLY load_assignment: cluster_name: service_envoyproxy_io endpoints: - lb_endpoints: - endpoint: address: socket_address: address: www.envoyproxy.io port_value: 443 transport_socket: name: envoy.transport_sockets.tls typed_config: "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext sni: www.envoyproxy.io - name: tags_service connect_timeout: 30s type: strict_dns lb_policy: round_robin http2_protocol_options: {} load_assignment: cluster_name: tags_service endpoints: - lb_endpoints: - endpoint: address: socket_address: address: localapp-tags port_value: 80 - name: docs_service connect_timeout: 30s type: strict_dns lb_policy: round_robin http2_protocol_options: {} load_assignment: cluster_name: docs_service endpoints: - lb_endpoints: - endpoint: address: socket_address: address: localapp-docs port_value: 80 layered_runtime: layers: - name: static_layer_0 static_layer: envoy: resource_limits: listener: example_listener_name: connection_limit: 10000
所以,是的,我有点困在这里试图找出我错过/搞砸的东西(但在这两周后我可能只是代码盲)。 envoy.yaml 文件是从参考资料中复制的,所以我只是遗漏了一些明显的东西(希望这不仅仅是 ico 问题!)。
跟踪日志中有一些错误,包括上面的主要错误,但我还没有弄清楚问题(或欣赏/理解跟踪日志)!摘录:
[2021-02-28 10:51:10.705][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442380 for 3600000ms,min is 3600000ms [2021-02-28 10:51:10.705][17][debug][conn_handler] [source/server/connection_handler_impl.cc:501] [C2] new connection [2021-02-28 10:51:10.705][17][trace][connection] [source/common/network/connection_impl.cc:548] [C2] socket event: 2 [2021-02-28 10:51:10.705][17][trace][connection] [source/common/network/connection_impl.cc:657] [C2] write ready [2021-02-28 10:51:10.707][17][trace][connection] [source/common/network/connection_impl.cc:548] [C2] socket event: 3 [2021-02-28 10:51:10.707][17][trace][connection] [source/common/network/connection_impl.cc:657] [C2] write ready [2021-02-28 10:51:10.707][17][trace][connection] [source/common/network/connection_impl.cc:586] [C2] read ready. dispatch_buffered_data=false [2021-02-28 10:51:10.707][17][trace][connection] [source/common/network/raw_buffer_socket.cc:25] [C2] read returns: 357 [2021-02-28 10:51:10.707][17][trace][connection] [source/common/network/raw_buffer_socket.cc:39] [C2] read error: Resource temporarily unavailable [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:571] [C2] parsing 357 bytes [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:847] [C2] message begin [2021-02-28 10:51:10.708][17][debug][http] [source/common/http/conn_manager_impl.cc:254] [C2] new stream [2021-02-28 10:51:10.708][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442400 for 300000ms,min is 300000ms [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Host value=host.docker.internal:10080 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=User-Agent value=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Accept value=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Accept-Language value=en-US,en;q=0.5 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Accept-Encoding value=gzip,deflate [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Connection value=keep-alive [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:699] [C2] onHeadersCompleteBase [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:494] [C2] completed header: key=Upgrade-Insecure-Requests value=1 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:952] [C2] Server: onHeadersComplete size=7 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:823] [C2] message complete [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:346] [C2] readDisable: disable=true disable_count=0 state=0 buffer_length=357 [2021-02-28 10:51:10.708][17][debug][http] [source/common/http/conn_manager_impl.cc:886] [C2][S9636672460028773107] request headers complete (end_stream=true): ':authority','host.docker.internal:10080' ':path','/t/api/Tags' ':method','GET' 'user-agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0' 'accept','text/html,*/*;q=0.8' 'accept-language','en-US,en;q=0.5' 'accept-encoding','gzip,deflate' 'connection','keep-alive' 'upgrade-insecure-requests','1' [2021-02-28 10:51:10.708][17][debug][http] [source/common/http/filter_manager.cc:755] [C2][S9636672460028773107] request end stream [2021-02-28 10:51:10.708][17][debug][router] [source/common/router/router.cc:425] [C2][S9636672460028773107] cluster 'tags_service' match for URL '/t/api/Tags' [2021-02-28 10:51:10.708][17][debug][router] [source/common/router/router.cc:582] [C2][S9636672460028773107] router decoding headers: ':authority','GET' ':scheme','http' 'user-agent',ap plication/xhtml+xml,deflate' 'upgrade-insecure-requests','1' 'x-forwarded-proto','http' 'x-request-id','d3ddb11a-85bb-479e-a29f-b850439d04aa' 'x-envoy-expected-rq-timeout-ms','15000' [2021-02-28 10:51:10.708][17][debug][pool] [source/common/http/conn_pool_base.cc:79] queueing stream due to no available connections [2021-02-28 10:51:10.708][17][debug][pool] [source/common/conn_pool/conn_pool_base.cc:106] creating a new connection [2021-02-28 10:51:10.708][17][debug][client] [source/common/http/codec_client.cc:41] [C3] connecting [2021-02-28 10:51:10.708][17][debug][connection] [source/common/network/connection_impl.cc:860] [C3] connecting to 172.18.0.11:80 [2021-02-28 10:51:10.708][17][debug][connection] [source/common/network/connection_impl.cc:876] [C3] connection in progress [2021-02-28 10:51:10.708][17][trace][http2] [source/common/http/http2/codec_impl.cc:1355] Codec does not have Metadata frame support. [2021-02-28 10:51:10.708][17][debug][http2] [source/common/http/http2/codec_impl.cc:1184] [C3] updating connection-level initial window size to 268435456 [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/filter_manager.cc:498] [C2][S9636672460028773107] decode headers called: filter=0x1e07bf442100 status=1 [2021-02-28 10:51:10.708][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442400 for 10000ms,min is 10000ms [2021-02-28 10:51:10.708][17][trace][http] [source/common/http/http1/codec_impl.cc:620] [C2] parsed 357 bytes [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:548] [C2] socket event: 2 [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:657] [C2] write ready [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:548] [C3] socket event: 2 [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:657] [C3] write ready [2021-02-28 10:51:10.708][17][debug][connection] [source/common/network/connection_impl.cc:666] [C3] connected [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:407] [C3] raising connection event 2 [2021-02-28 10:51:10.708][17][debug][client] [source/common/http/codec_client.cc:80] [C3] connected [2021-02-28 10:51:10.708][17][debug][pool] [source/common/conn_pool/conn_pool_base.cc:225] [C3] attaching to next stream [2021-02-28 10:51:10.708][17][debug][pool] [source/common/conn_pool/conn_pool_base.cc:130] [C3] creating stream [2021-02-28 10:51:10.708][17][debug][router] [source/common/router/upstream_request.cc:354] [C2][S9636672460028773107] pool ready [2021-02-28 10:51:10.708][17][trace][http2] [source/common/http/http2/codec_impl.cc:946] [C3] send data: bytes=24 [2021-02-28 10:51:10.708][17][trace][connection] [source/common/network/connection_impl.cc:465] [C3] writing 24 bytes,end_stream false [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:924] [C3] about to send frame type=4,flags=0 [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:946] [C3] send data: bytes=39 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:465] [C3] writing 39 bytes,end_stream false [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:853] [C3] sent frame type=4 [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:924] [C3] about to send frame type=8,flags=0 [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:946] [C3] send data: bytes=13 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:465] [C3] writing 13 bytes,end_stream false [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:853] [C3] sent frame type=8 [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:924] [C3] about to send frame type=1,flags=5 [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:946] [C3] send data: bytes=282 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:465] [C3] writing 282 bytes,end_stream false [2021-02-28 10:51:10.709][17][trace][http2] [source/common/http/http2/codec_impl.cc:853] [C3] sent frame type=1 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:657] [C3] write ready [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/raw_buffer_socket.cc:68] [C3] write returns: 358 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:548] [C3] socket event: 2 [2021-02-28 10:51:10.709][17][trace][connection] [source/common/network/connection_impl.cc:657] [C3] write ready [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/connection_impl.cc:548] [C3] socket event: 3 [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/connection_impl.cc:657] [C3] write ready [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/connection_impl.cc:586] [C3] read ready. dispatch_buffered_data=false [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/raw_buffer_socket.cc:25] [C3] read returns: 135 [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/raw_buffer_socket.cc:39] [C3] read error: Resource temporarily unavailable [2021-02-28 10:51:10.714][17][trace][http2] [source/common/http/http2/codec_impl.cc:644] [C3] dispatching 135 bytes [2021-02-28 10:51:10.714][17][debug][http2] [source/common/http/http2/codec_impl.cc:890] [C3] invalid http2: Remote peer returned unexpected data while we expected SETTINGS frame. Perhaps,peer does not support HTTP/2 properly. [2021-02-28 10:51:10.714][17][trace][http2] [source/common/http/http2/codec_impl.cc:671] [C3] dispatched 135 bytes [2021-02-28 10:51:10.714][17][trace][http2] [source/common/http/http2/codec_impl.cc:924] [C3] about to send frame type=7,flags=0 [2021-02-28 10:51:10.714][17][trace][http2] [source/common/http/http2/codec_impl.cc:946] [C3] send data: bytes=34 [2021-02-28 10:51:10.714][17][trace][connection] [source/common/network/connection_impl.cc:465] [C3] writing 34 bytes,end_stream false [2021-02-28 10:51:10.715][17][trace][http2] [source/common/http/http2/codec_impl.cc:853] [C3] sent frame type=7 [2021-02-28 10:51:10.715][17][debug][http2] [source/common/http/http2/codec_impl.cc:856] [C3] sent goaway code=1 [2021-02-28 10:51:10.715][17][debug][client] [source/common/http/codec_client.cc:137] [C3] Error dispatching received data: The user callback function failed [2021-02-28 10:51:10.715][17][debug][connection] [source/common/network/connection_impl.cc:132] [C3] closing data_to_write=34 type=1 [2021-02-28 10:51:10.715][17][trace][connection] [source/common/network/raw_buffer_socket.cc:68] [C3] write returns: 34 [2021-02-28 10:51:10.715][17][debug][connection] [source/common/network/connection_impl.cc:241] [C3] closing socket: 1 [2021-02-28 10:51:10.715][17][trace][connection] [source/common/network/connection_impl.cc:407] [C3] raising connection event 1 [2021-02-28 10:51:10.716][17][debug][client] [source/common/http/codec_client.cc:99] [C3] disconnect. resetting 1 pending requests [2021-02-28 10:51:10.716][17][debug][client] [source/common/http/codec_client.cc:125] [C3] request reset [2021-02-28 10:51:10.716][17][trace][main] [source/common/event/dispatcher_impl.cc:213] item added to deferred deletion list (size=1) [2021-02-28 10:51:10.716][17][debug][pool] [source/common/conn_pool/conn_pool_base.cc:159] [C3] destroying stream: 0 remaining [2021-02-28 10:51:10.716][17][debug][router] [source/common/router/router.cc:1026] [C2][S9636672460028773107] upstream reset: reset reason: connection termination,transport failure reason: [2021-02-28 10:51:10.716][17][debug][http] [source/common/http/filter_manager.cc:839] [C2][S9636672460028773107] Sending local reply with details upstream_reset_before_response_started{connection termination} [2021-02-28 10:51:10.716][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442400 for 10000ms,min is 10000ms [2021-02-28 10:51:10.716][17][debug][http] [source/common/http/conn_manager_impl.cc:1484] [C2][S9636672460028773107] encoding headers via codec (end_stream=false): ':status','503' 'content-length','95' 'content-type','text/plain' 'date','Sun,28 Feb 2021 10:51:10 GMT' 'server','envoy' [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/connection_impl.cc:465] [C2] writing 134 bytes,end_stream false [2021-02-28 10:51:10.716][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442400 for 10000ms,min is 10000ms [2021-02-28 10:51:10.716][17][trace][http] [source/common/http/conn_manager_impl.cc:1493] [C2][S9636672460028773107] encoding data via codec (size=95 end_stream=true) [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/connection_impl.cc:465] [C2] writing 95 bytes,end_stream false [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/connection_impl.cc:346] [C2] readDisable: disable=false disable_count=1 state=0 buffer_length=0 [2021-02-28 10:51:10.716][17][trace][main] [source/common/event/dispatcher_impl.cc:213] item added to deferred deletion list (size=2) [2021-02-28 10:51:10.716][17][trace][misc] [source/common/event/scaled_range_timer_manager_impl.cc:60] enableTimer called on 0x1e07bf442380 for 3600000ms,min is 3600000ms [2021-02-28 10:51:10.716][17][debug][pool] [source/common/conn_pool/conn_pool_base.cc:343] [C3] client disconnected,failure reason: [2021-02-28 10:51:10.716][17][trace][main] [source/common/event/dispatcher_impl.cc:213] item added to deferred deletion list (size=3) [2021-02-28 10:51:10.716][17][trace][main] [source/common/event/dispatcher_impl.cc:89] clearing deferred deletion list (size=3) [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/connection_impl.cc:548] [C2] socket event: 2 [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/connection_impl.cc:657] [C2] write ready [2021-02-28 10:51:10.716][17][trace][connection] [source/common/network/raw_buffer_socket.cc:68] [C2] write returns: 229 [2021-02-28 10:51:10.747][17][trace][connection] [source/common/network/connection_impl.cc:548] [C2] socket event: 3 [2021-02-28 10:51:10.747][17][trace][connection] [source/common/network/connection_impl.cc:657] [C2] write ready [2021-02-28 10:51:10.747][17][trace][connection] [source/common/network/connection_impl.cc:586] [C2] read ready. dispatch_buffered_data=false [2021-02-28 10:51:10.747][17][trace][connection] [source/common/network/raw_buffer_socket.cc:25] [C2] read returns: 323 [2021-02-28 10:51:10.747][17][trace][connection] [source/common/network/raw_buffer_socket.cc:39] [C2] read error: Resource temporarily unavailable
来自上述会话的完整跟踪日志... here。
对于任何指点或建议,我们深表歉意并提前致谢。我可以根据需要提供任何缺失的参考文档。
再次感谢!
解决方法
我打算再给它几天时间,但我想我发现了问题......似乎是手指粗,复制和粘贴。
- 我删除了上面评论中提到的有问题的空 http2 选项。这在集群中得到了解决:
- name: tags_service connect_timeout: 30s type: strict_dns lb_policy: round_robin # http2_protocol_options: {} !remove these lines load_assignment: cluster_name: tags_service endpoints: - lb_endpoints: - endpoint: address: socket_address: address: localapp-tags port_value: 80
- 一旦“错误”消失,我只剩下一个普通的空白页和内部 404 错误(通过 curl 看到)......我意识到需要修改路由器指令:
route: cluster: tags_service auto_host_rewrite: true prefix_rewrite: "/" # add this line so that we remove the /{route}/ from the gw idle_timeout: 10s
现在我将返回并重新启用我之前的一些设置,也许会尝试Edge Proxy Settings。至少它现在运行正常,我学到了很多东西。
最好的部分是 SO 在这个过程中扮演的角色。 (这不是讽刺!)在用不同的工作示例跳来跳去几天之后,我当然将一些不正确的东西复制到我的配置中(我猜我需要更多的 RTFM)。发布一个 SO 问题会让人们重新评估所采取的所有步骤和流程,并点燃一点火。
谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。