Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (71.8m points)

envoyproxy - Unable to access host port from docker container(envoy)

I am running envoy proxy in Docker for windows, I am running a simple web application in "localhost:1112". Envoy is configured to listen 8080. Below is my configuration file.

static_resources:

listeners:

- address:

    socket_address: { address: 0.0.0.0, port_value: 8080 }

  filter_chains:

    - filters:

      - name: envoy.filters.network.http_connection_manager

        typed_config: 

          '@type': 

"type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"

          stat_prefix: http_proxy

          route_config: 

            name: all   #this can be any name

            virtual_hosts:

              - name: allbackend_cluster   #this can be any name

                domains: 

                  - '*'

                routes:

                  - match: { prefix: "/admin"}

                    direct_response: {status: 403, body: { inline_string: 

"Forbidden, yo"} }

                  - match: { prefix: "/"}

                    route:

                      cluster: allbackend_cluster

          http_filters:

              - name: envoy.filters.http.router

clusters:

- name: allbackend_cluster


  connect_timeout: 1s

  type: strict_dns

  lb_policy: round_robin

  load_assignment:

    cluster_name: allbackend_cluster

    endpoints:

      - lb_endpoints:

        - endpoint:

            address:

              socket_address:

                address: localhost

                port_value: 1112

I am running envoy using below command: docker run --name=envoyHttp -p 8080:8080 -v %cd%/http1.yaml:/http1.yaml envoyproxy/envoy:v1.16-latest -c /http1.yaml

When i try to access http://localhost:8080/ getting below error

"upstream connect error or disconnect/reset before headers. reset reason: connection failure".

Can anyone please help me on this, I am new to Envoy and Docker


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...