Port number in Host header will result in envoy's 404

380 views
Skip to first unread message

ch...@winguse.com

unread,
Oct 19, 2017, 7:46:48 PM10/19/17
to envoy-users
I am wondering if this is correct behavior:

Envoy's egress port is listening on 12345, routing to www.google.com:80, config as below:

listeners:

- address: tcp://127.0.0.1:12345

  filters:

  - name: http_connection_manager

    type: read

    config:

      codec_type: http1

      stat_prefix: egress_http

      route_config:

        virtual_hosts:

        - name: local_service

          domains: ["www.google.com"]

          routes:

          - prefix: "/"

            timeout_ms: 0

            cluster: service_google

      filters:

      - { type: decoder, name: router, config: {} }


admin:

  access_log_path: /tmp/admin_access.log

  address: tcp://127.0.0.1:19901


cluster_manager:

  clusters:

  - name: service_google

    connect_timeout_ms: 250

    type: logical_dns

    lb_type: round_robin

    hosts: [{ url: tcp://www.google.com:80 }]


When I nc to it:

1. If I send host header with port, I will get Envoy's 404.
2. If I send host header without port number, it works as expected.

See:

$ nc 127.0.0.1 12345

GET /generate_204 HTTP/1.1

Host: www.google.com:12345


HTTP/1.1 404 Not Found

date: Thu, 19 Oct 2017 23:43:09 GMT

server: envoy

content-length: 0


GET /generate_204 HTTP/1.1

Host: www.google.com


HTTP/1.1 204 No Content

content-length: 0

date: Thu, 19 Oct 2017 23:43:20 GMT

x-envoy-upstream-service-time: 2

server: envoy



According to RFC2616 ( https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 ), port number should be specify if it's not 80. So I think this behavior is something wrong.

Matt Klein

unread,
Oct 19, 2017, 7:53:14 PM10/19/17
to Yingyu Cheng, envoy-users
There are a few issues here: https://github.com/envoyproxy/envoy/issues/1269

In general yes we are probably RFC broken in terms of port handling.

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users+unsubscribe@googlegroups.com.
To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/5fea25d7-b45c-4fea-8372-d6ff0f21a157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages