1

I'm trying to proxy HTTP requests to external proxy with Istio egress gateway+ServiceEntry or ServiceEntry+VirtualService, adding a HTTP header before route request to external proxy but I don't find a similar example.

Is it possible ?

I've proved different configurations but they didn't work.

For example:

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: proxy
  namespace: lab
spec:
  hosts:
  - externalproxy
  location: MESH_EXTERNAL
  ports:
  - number: 3128
    name: http
    protocol: HTTP
  resolution: DNS

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: proxy-virtualservice
  namespace: lab
spec:
  hosts:
  - myservice
  http:
  - match:
    port: 3128
    rewrite:
      authority: externalproxy
    route:
    - destination:
        host: externalproxy
        port:
          number: 3128
    headers:
      request:
        add:
          myheader: test

Thanks

  • I think your configuration is correct, for example there is [example](https://stackoverflow.com/questions/59533472/istio-adds-and-removed-headers-but-doesnt-overwrite) with request headers. And there is one with [response headers](https://stackoverflow.com/questions/60818880/istio-virtual-service-header-rules-are-not-applied/60826906#60826906). As they we're made for internal services I'm not sure what about external service as a host, couldn't find any example with that. As far as I understand your vs and se works, but the problem is with request headers? How do you check if it works? – Jakub May 12 '20 at 09:56
  • It doesn't work. I think I need to use Envoy "HTTP dynamic forward proxy" https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_proxy – JoseAntonioSA May 27 '20 at 05:50

0 Answers0