# Routing egress traffic to wildcard destinations

DevFeed: [Routing egress traffic to wildcard destinations](<https://devfeed.tech/articles/routing-egress-traffic-to-wildcard-destinations-48763.md>)

Original publisher: [Read original article](<https://istio.io/latest/blog/2023/egress-sni/>)

Author: Gergő Huszty (IBM)

Published: 2023-12-01T00:00:00Z

Content type: article

Language: en

Sources: [Istio](<https://devfeed.tech/sources/istio-blog.md>)

Topics: [istio](<https://devfeed.tech/topics/istio.md>), [Network](<https://devfeed.tech/topics/network.md>), [proxy](<https://devfeed.tech/topics/proxy.md>), [HTTP](<https://devfeed.tech/topics/http.md>)

Tags: [egress](<https://devfeed.tech/tags/egress.md>), [gateway](<https://devfeed.tech/tags/gateway.md>), [handshake](<https://devfeed.tech/tags/handshake.md>), [http](<https://devfeed.tech/tags/http.md>), [istio](<https://devfeed.tech/tags/istio.md>), [mesh](<https://devfeed.tech/tags/mesh.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [mtls](<https://devfeed.tech/tags/mtls.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [remote](<https://devfeed.tech/tags/remote.md>), [routing](<https://devfeed.tech/tags/routing.md>), [services](<https://devfeed.tech/tags/services.md>), [tcp](<https://devfeed.tech/tags/tcp.md>), [traffic](<https://devfeed.tech/tags/traffic.md>), [traffic-management](<https://devfeed.tech/tags/traffic-management.md>), [wildcard](<https://devfeed.tech/tags/wildcard.md>)

## AI overview

This article explains how to route egress traffic from Istio service meshes to wildcard external destinations. It describes a migration approach using Istio-independent components and Envoy features, avoiding a separate Nginx SNI proxy after changes in Istio 1.20.

## Source excerpt

If you are using Istio to handle application-originated traffic to destinations outside of the mesh, you're probably familiar with the concept of egress gateways. Egress gateways can be used to monitor and forward traffic from mesh-internal applications to locations outside of the mesh. This is a useful feature if your system is operating in a restricted environment and you want to control what can be reached on the public internet from your mesh. The use-case of configuring an egress gateway to handle arbitrary wildcard domains had been included in the official Istio docs up until version 1.13, but was subsequently removed because the documented solution was not officially supported or recommended and was subject to breakage in future versions of Istio. Nevertheless, the old solution was still usable with Istio versions before 1.20. Istio 1.20, however, dropped some Envoy functionality that was required for the approach to work. This post attempts to describe how we resolved the issue and filled the gap with a similar approach using Istio version-independent components and Envoy features, but without the need for a separate Nginx SNI proxy. Our approach allows users of the old solution to seamlessly migrate configurations before their systems face the breaking changes in Istio 1.20. Problem to solve The currently documented egress gateway use-cases rely on the fact that the target of the traffic (the hostname) is statically configured in a VirtualService, telling Envoy in the egress gateway pod where to TCP proxy the matching outbound connections. You can use multiple, and even wildcard, DNS names to match the routing criteria, but you are not able to route the traffic to the exact location specified in the application request. For example you can match traffic for targets *.wikipedia.org, but you then need to forward the traffic to a single final target, e.g., en.wikipedia.org. If there is another service, e.g., anyservice.wikipedia.org, that is not hosted by the